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.4 1997/05/31 22:03:40 grubba Exp $ */ + /* $Id: test_pike.pike,v 1.5 1998/01/03 07:11:24 hubbe Exp $ */      #include <simulate.h>      #if !efun(_verify_internals)   #define _verify_internals()   #endif         int main(int argc, string *argv)   {    int e, verbose, successes, errors, t, check; -  string *tests; +  string *tests,tmp;    program testprogram;    int start, fail, mem;    int loop=1;       for(e=1;e<argc;e++)    {    string opt;    int arg;    arg=1;    if(sscanf(argv[e],"--%s=%d",opt,arg)==2)
pike.git/bin/test_pike.pike:74:    case "--memory":    mem++;    break;       default:    if(tests)    {    perror("Unknown argument: "+opt+".\n");    exit(1);    } -  tests=(read_bytes(argv[e])||"")/"\n....\n"; +  tmp=read_bytes(argv[e]); +  if(!tmp) +  { +  perror("Failed to read test file, errno="+errno()+".\n"); +  exit(1);    }    } -  -  if(!tests) -  { -  tests=(clone((program)"/precompiled/file","stdin")->read(0x7fffffff)||"")/"\n....\n"; +     }    -  if(!tests) +  if(!tmp)    { -  perror("Failed to read test file!\n"); +  tmp=Stdio.stdin->read(0x7fffffff); +  if(!tmp) +  { +  perror("Failed to read test file, errno="+errno()+".\n");    exit(1);    } -  +  }    -  +  +  tests=tmp/"\n....\n";    tests=tests[0..sizeof(tests)-2];       while(loop--)    {    successes=errors=0;       for(e=start;e<sizeof(tests);e++)    {    string test,condition;    int type;