pike.git / bin / test_pike.pike

version» Context lines:

pike.git/bin/test_pike.pike:1:   #!/usr/local/bin/pike    - /* $Id: test_pike.pike,v 1.70 2002/08/06 18:34:41 nilsson Exp $ */ + /* $Id: test_pike.pike,v 1.71 2002/08/20 23:07:33 nilsson Exp $ */      import Stdio;      #if !constant(_verify_internals)   #define _verify_internals()   #endif      #if !constant(_dmalloc_set_name)   void _dmalloc_set_name(mixed ... args) {}   #endif
pike.git/bin/test_pike.pike:385:    tests = read_tests( testsuite );       werror("Doing tests in %s (%d tests)\n", testsuite, sizeof(tests));    int qmade, qskipped, qmadep, qskipp;       for(e=start;e<sizeof(tests);e++)    {    signal_watchdog();       int skip=0, prev_errors = errors; -  string test,condition; -  string|int type; +     object o;    mixed a,b;    -  +  // Extra consistency checks?    if(check)    {    if(check>0 || (e % -check)==0 )    _verify_internals();    }    if(check>3) {    gc();    _verify_internals();    }    -  test=tests[e]; +  string test = tests[e]; +  +  // Is there a condition for this test? +  string condition;    if( sscanf(test, "COND %s\n%s", condition, test)==2 )    {    int tmp;    if(!(tmp=cond_cache[condition]))    {    mixed err = catch {    tmp=!!(compile_string("mixed c() { return "+condition+"; }",    "Cond "+(e+1))()->c());    };   
pike.git/bin/test_pike.pike:432:    if(tmp==-1)    {    if(verbose>1)    werror("Not doing test "+(e+1)+"\n");    successes++;    skipped++;    skip=1;    }    }    -  int testno, testline; +  string|int type;    sscanf(test, "%s\n%s", type, test); -  sscanf(type, "%s: test %d, expected result: %s", string testfile, testno, type); +     -  +  int testno, testline; +  string testfile; +  sscanf(type, "%s: test %d, expected result: %s", testfile, testno, type); +     if (testfile) {    array split = testfile / ":";    testline = (int) split[-1];    testfile = split[..sizeof (split) - 2] * ":";    }       string pad_on_error = "\n";    if(istty())    {    if(!verbose) {
pike.git/bin/test_pike.pike:471:    qmade++;    }    }    else {    /* Use + instead of . so that sendmail and    * cron will not cut us off... :(    */    switch( (e-start) % 50)    {    case 0: -  werror("%5d: ",e); +  werror("%5d: ", e); +  // fallthrough +  +  default: +  werror(skip?"-":"+");    break;       case 9:    case 19:    case 29:    case 39:    werror(skip?"- ":"+ ");    break;    -  default: -  werror(skip?"-":"+"); -  break; -  +     case 49:    werror(skip?"-\n":"+\n");    }    }    if(skip) continue;       if (!testfile || !testno || !type) {    werror ("%sInvalid format in test file: %O\n", pad_on_error, type);    errors++;    continue;
pike.git/bin/test_pike.pike:886:   -v[level],   --verbose[=level] Select the level of verbosity. Every verbose level includes    the printouts from the levels below.    0 No extra printouts.    1 Some additional information printed out after every    finished block of tests.    2 Some extra information about test that will or won't be    run.    3 Every test is printed out.    4 Time spent in individual tests are printed out. -  10 The actual pike code compiled, including wrappers, is +  10 The actual Pike code compiled, including wrappers, is    printed.   -p, --prompt The user will be asked before every test is run.   -sX, --start-test=X Where in the testsuite testing should start, e.g. ignores X    tests in every testsuite.   -eX, --end-after=X How many tests should be run.   -f, --fail If set, the testsuite always fails.   -lX, --loop=X The number of times the testsuite should be run. Default is    1.   -tX, --trace=X Run tests with trace level X. - -c[X], --check[=X] The level of extra pike consistency checks performed. + -c[X], --check[=X] The level of extra Pike consistency checks performed.    1 _verify_internals is run before every test.    2 _verify_internals is run after every compilation.    3 _verify_internals is run after every test.    4 An extra gc and _verify_internals is run before    every test.    X<0 For values below zero, _verify_internals will be run    before every n:th test, where n=abs(X).   -m, --mem, --memory Print out memory allocations after the tests.   -a, --auto Let the test program find the testsuits self.   -T, --notty Format output for non-tty.   -d, --debug Opens a debug port.   ";