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.16 1999/02/20 20:22:30 grubba Exp $ */ + /* $Id: test_pike.pike,v 1.17 1999/02/20 21:27:50 grubba Exp $ */      #include <simulate.h>      #if !efun(_verify_internals)   #define _verify_internals()   #endif    -  + #define SHIFT_MAX 0 /* 3 */ +    int foo(string opt)   {    if(opt=="" || !opt) return 1;    return (int)opt;   }      mapping(string:int) cond_cache=([]);      #if constant(thread_create)   #define HAVE_DEBUG
pike.git/bin/test_pike.pike:161:    sscanf(test,"%s\n%s",type,test);    sscanf(type,"%*s expected result: %s",type);       if(verbose)    {    werror("Doing test %d (%d total)%s\n",e+1,successes+errors+1,extra_info);    if(verbose>1)    werror(test+"\n");    }    +  for(int shift=0;shift <= SHIFT_MAX;shift++) { +     if(check > 1) _verify_internals();    -  string fname = argv[f] + ": Test " + (e + 1); +  string fname = argv[f] + ": Test " + (e + 1) + +  " (shift " + shift + ")";    -  +  string widener = ([ 0:"", +  1:"\nint \x30c6\x30b9\x30c8=0;\n", +  2:"\nint \x10001=0;\n" ])[shift]; +     switch(type)    {    case "COMPILE": -  if(catch(compile_string(test, fname))) +  if(catch(compile_string(test + widener, fname)))    {    werror(fname + " failed.\n");    werror(test+"\n");    errors++;    }else{    successes++;    }    break;       case "COMPILE_ERROR":    master()->set_inhibit_compile_errors(1); -  if(catch(compile_string(test, fname))) +  if(catch(compile_string(test + widener, fname)))    {    successes++;    }else{    werror(fname + " failed.\n");    werror(test+"\n");    errors++;    }    master()->set_inhibit_compile_errors(0);    break;       case "EVAL_ERROR":    master()->set_inhibit_compile_errors(1); -  if(catch(clone(compile_string(test, fname))->a())) +  if(catch(clone(compile_string(test + widener, fname))->a()))    {    successes++;    }else{    werror(fname + " failed.\n");    werror(test+"\n");    errors++;    }    master()->set_inhibit_compile_errors(0);    break;       default: -  o=clone(compile_string(test,fname)); +  o=clone(compile_string(test + widener,fname));       if(check > 1) _verify_internals();       a=b=0;    if(t) trace(t);    if(functionp(o->a)) a=o->a();    if(functionp(o->b)) b=o->b();    if(t) trace(0);       if(check > 1) _verify_internals();
pike.git/bin/test_pike.pike:284:    werror(sprintf("%s: Unknown test type (%O).\n", fname, type));    errors++;    }    }       if(check > 2) _verify_internals();       if(fail && errors)    exit(1);    +  } +     if(!--end) exit(0);       a=b=0;    }       }    if(mem)    {    int total;    tests=0;