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.58 2001/09/11 05:36:17 hubbe Exp $ */ + /* $Id: test_pike.pike,v 1.59 2001/10/01 19:53:35 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:517:    if(verbose>9) bzot(to_compile);    switch(type)    {    mixed at,bt;    mixed err;    case "COMPILE":    _dmalloc_set_name(fname,0);    if(catch(compile_string(to_compile, fname)))    {    _dmalloc_set_name(); -  werror(fname + " failed.\n"); +  werror("\n" + fname + " failed.\n");    bzot(test);    errors++;    }else{    _dmalloc_set_name();    successes++;    }    break;       case "COMPILE_ERROR":    master()->set_inhibit_compile_errors(1);    _dmalloc_set_name(fname,0);    if(catch(compile_string(to_compile, fname)))    {    _dmalloc_set_name();    successes++;    }else{    _dmalloc_set_name(); -  werror(fname + " failed (expected compile error).\n"); +  werror("\n" + fname + " failed (expected compile error).\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);   
pike.git/bin/test_pike.pike:559:    };    };    if(err)    {    _dmalloc_set_name();    successes++;    if(verbose>2)    werror("Time in a(): %f\n",at);    }else{    _dmalloc_set_name(); -  werror(fname + " failed (expected eval error).\n"); +  werror("\n" + fname + " failed (expected eval error).\n");    bzot(test);    errors++;    }    master()->set_inhibit_compile_errors(0);    break;       default:    if (err = catch{    _dmalloc_set_name(fname,0);    o=clone(compile_string(to_compile,fname));
pike.git/bin/test_pike.pike:596:    bt = gauge { b=o->b(); };    }       _dmalloc_set_name();       if(t) trace(0);    if(check > 1) _verify_internals();       }) {    // trace(0); -  werror(fname + " failed.\n"); +  werror("\n" + fname + " failed.\n");    bzot(test);    if (arrayp(err) && sizeof(err) && stringp(err[0])) {    werror("Error: " + master()->describe_backtrace(err));    }    if (objectp(err)) {    werror("Error: " + master()->describe_backtrace(err));    }    errors++;    break;    }       if( o->__cpp_line != o->__rtl_line ||    ( computed_line && computed_line!=o->__cpp_line))    { -  werror(fname + " Line numbering failed.\n"); +  werror("\n" + fname + " Line numbering failed.\n");    bzot(test + linetester);    werror(" CPP lines: %d\n",o->__cpp_line);    werror(" RTL lines: %d\n",o->__rtl_line);    if(computed_line)    werror("Actual lines: %d\n",computed_line);    errors++;    }       if(verbose>2)    werror("Time in a(): %f, Time in b(): %O\n",at,bt);       switch(type)    {    case "FALSE":    if(a)    { -  werror(fname + " failed.\n"); +  werror("\n" + fname + " failed.\n");    bzot(test);    werror(sprintf("o->a(): %O\n",a));    errors++;    }else{    successes++;    }    break;       case "TRUE":    if(!a)    { -  werror(fname + " failed.\n"); +  werror("\n" + fname + " failed.\n");    bzot(test);    werror(sprintf("o->a(): %O\n",a));    errors++;    }else{    successes++;    }    break;       case "RUN":    successes++;    break;       case "EQ":    if(a!=b)    { -  werror(fname + " failed.\n"); +  werror("\n" + fname + " failed.\n");    bzot(test);    werror(sprintf("o->a(): %O\n",a));    werror(sprintf("o->b(): %O\n",b));    errors++;    }else{    successes++;    }    break;       case "EQUAL":    if(!equal(a,b))    { -  werror(fname + " failed.\n"); +  werror("\n" + fname + " failed.\n");    bzot(test);    werror(sprintf("o->a(): %O\n",a));    werror(sprintf("o->b(): %O\n",b));    errors++;    }else{    successes++;    }    break;       default: -  werror(sprintf("%s: Unknown test type (%O).\n", fname, type)); +  werror(sprintf("\n%s: Unknown test type (%O).\n", fname, type));    errors++;    }    }       if(check > 2) _verify_internals();       if(fail && errors)    exit(1);       if(successes+errors > end)