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.9 1998/04/08 22:05:36 hubbe Exp $ */ + /* $Id: test_pike.pike,v 1.10 1998/04/09 21:10:19 hubbe Exp $ */      #include <simulate.h>      #if !efun(_verify_internals)   #define _verify_internals()   #endif      int foo(string opt)   {    if(opt=="" || !opt) return 1;
pike.git/bin/test_pike.pike:15:   }   int main(int argc, string *argv)   {    int e, verbose, successes, errors, t, check;    string *tests,tmp;    program testprogram;    int start, fail, mem;    int loop=1;    int end=0x7fffffff;    +  string *args=backtrace()[0][3]; +  args=args[..sizeof(args)-1-argc]; +  add_constant("RUNPIKE",args*" "); +     foreach(Getopt.find_all_options(argv,aggregate(    ({"help",Getopt.NO_ARG,({"-h","--help"})}),    ({"verbose",Getopt.NO_ARG,({"-v","--verbose"})}),    ({"start",Getopt.HAS_ARG,({"-s","--start-test"})}),    ({"end",Getopt.HAS_ARG,({"--end-after"})}),    ({"fail",Getopt.MAY_HAVE_ARG,({"-f","--fail"})}),    ({"loop",Getopt.MAY_HAVE_ARG,({"-l","--loop"})}),    ({"trace",Getopt.MAY_HAVE_ARG,({"-t","--trace"})}),    ({"check",Getopt.MAY_HAVE_ARG,({"-c","--check"})}),    ({"mem",Getopt.MAY_HAVE_ARG,({"-m","--mem","--memory"})}),
pike.git/bin/test_pike.pike:108:    {    werror("Doing test "+(e+1)+"\n");    if(verbose>1)    werror(test+"\n");    }       if(check > 1) _verify_internals();       switch(type)    { +  case "COMPILE": +  if(catch(compile_string(test,"Test "+(e+1)))) +  { +  werror("Test "+(e+1)+" failed.\n"); +  werror(test+"\n"); +  errors++; +  }else{ +  successes++; +  } +  break; +     case "COMPILE_ERROR":    master()->set_inhibit_compile_errors(1);    if(catch(compile_string(test,"Test "+(e+1))))    {    successes++;    }else{    werror("Test "+(e+1)+" failed.\n");    werror(test+"\n");    errors++;    }