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.64 2002/05/05 00:01:28 mast Exp $ */ + /* $Id: test_pike.pike,v 1.65 2002/05/24 17:15:04 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:88:    if(!tests) {    werror("Failed to read test file %O, errno=%d.\n",    fn, errno());    exit(1);    }       tests = tests/"\n....\n";    return tests[0..sizeof(tests)-2];   }    + class WarningFlag { +  int(0..1) warning;    -  +  void compile_warning(mixed ... args) { +  warning = 1; +  } + } +    //   // Watchdog stuff   //      // 20 minutes should be enough..   #if !constant(_reset_dmalloc)   #define WATCHDOG_TIMEOUT 60*20   #else   // ... unless we're running dmalloc   #define WATCHDOG_TIMEOUT 60*80
pike.git/bin/test_pike.pike:203: Inside #if defined(WATCHDOG)
   werror("\n"    "[WATCHDOG] Giving up, must be a device wait.. :(\n");    _exit(0);    }    }   #else    _exit(1);   #endif   }    + // + // Main program + //      int main(int argc, array(string) argv)   {    int e, verbose, prompt, successes, errors, t, check;    int skipped, quiet;    array(string) tests;    program testprogram;    int start, fail, mem;    int loop=1;    int end=0x7fffffff;
pike.git/bin/test_pike.pike:261:    ({"fail",Getopt.NO_ARG,({"-f","--fail"})}),    ({"loop",Getopt.HAS_ARG,({"-l","--loop"})}),    ({"trace",Getopt.HAS_ARG,({"-t","--trace"})}),    ({"check",Getopt.MAY_HAVE_ARG,({"-c","--check"})}),    ({"mem",Getopt.NO_ARG,({"-m","--mem","--memory"})}),    ({"auto",Getopt.NO_ARG,({"-a","--auto"})}),    ({"notty",Getopt.NO_ARG,({"-T","--notty"})}),   #ifdef HAVE_DEBUG    ({"debug",Getopt.MAY_HAVE_ARG,({"-d","--debug"})}),   #endif +  ({"regression",Getopt.NO_ARG,({"-r","--regression"})}),    )),array opt)    {    switch(opt[0])    {    case "no-watchdog":    use_watchdog=0;    break;       case "watchdog":    run_watchdog( (int)opt[1] );
pike.git/bin/test_pike.pike:296:    case "fail": fail=1; break;    case "loop": loop=foo(opt[1]); break;    case "trace": t+=foo(opt[1]); break;    case "check": check+=foo(opt[1]); break;    case "mem": mem=1; break;       case "auto":    testsuites=find_testsuites(".");    break;    +  case "regression": +  add_constant("regression", 1); +  break; +    #ifdef HAVE_DEBUG    case "debug":    {    object p=Stdio.Port();    p->bind(0);    werror("Debug port is: %s\n",p->query_address());    sscanf(p->query_address(),"%*s %d",int portno);    extra_info+=sprintf(" dport:%d",portno);    thread_create(lambda(object p){    while(p)
pike.git/bin/test_pike.pike:580:    }    else {    _dmalloc_set_name();    werror(pad_on_error + fname + " failed (expected compile error).\n");    bzot(test);    errors++;    }    master()->set_inhibit_compile_errors(0);    break;    +  case "COMPILE_WARNING": +  WarningFlag wf = WarningFlag(); +  master()->set_inhibit_compile_errors(wf); +  _dmalloc_set_name(fname,0); +  if(catch(compile_string(to_compile, testsuite))) +  { +  _dmalloc_set_name(); +  werror(pad_on_error + fname + " failed.\n"); +  bzot(test); +  errors++; +  } +  else { +  _dmalloc_set_name(); +  if( wf->warning ) +  successes++; +  else { +  werror(pad_on_error + fname + " failed (expected compile warning).\n"); +  bzot(test); +  errors++; +  } +  } +  master()->set_inhibit_compile_errors(0); +  break; +     case "EVAL_ERROR":    master()->set_inhibit_compile_errors(1);    _dmalloc_set_name(fname,0);       at = gauge {    err=catch {    clone(compile_string(to_compile, testsuite))->a();    };    };    if(err)