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.75 2002/11/14 15:28:58 marcus Exp $ */ + /* $Id: test_pike.pike,v 1.76 2002/11/26 18:48: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:341: Inside #if defined(HAVE_DEBUG)
   Tools.Hilfe.GenericHilfe(q,q);    }    }    },p);    }   #endif    }    }       add_constant("_verbose", verbose); +  if(verbose) +  werror("Begin tests at "+ctime(time()));      #ifdef WATCHDOG    int watchdog_time=time();       if(use_watchdog)    {   #ifdef WATCHDOG_PIPE    object watchdog_tmp=Stdio.File();    watchdog_pipe=watchdog_tmp->pipe(Stdio.PROP_IPC);    watchdog=Process.create_process(
pike.git/bin/test_pike.pike:373:    add_constant("__signal_watchdog",lambda(){});   #endif // else WATCHDOG_PIPE       testsuites += Getopt.get_args(argv, 1)[1..];    if(!sizeof(testsuites))    {    werror("No tests found. Use --help for more information.\n");    exit(1);    }    + #if 1 +  // Store the name of all constants so that we can see +  // if any constant has been leaked from the testsuite. +  spider; +  array const_names = indices(all_constants()); + #endif +    #if constant(_assembler_debug)    if(asmdebug)    _assembler_debug(asmdebug);   #endif       while(loop--)    {    successes=errors=0;    testloop:    foreach(testsuites, string testsuite)
pike.git/bin/test_pike.pike:641:    }    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(); +  a = compile_string(to_compile, testsuite)()->a();    };    };    if(err)    {    _dmalloc_set_name();    successes++;    if(verbose>3)    werror("Time in a(): %f\n",at);    }    else {    _dmalloc_set_name();    werror(pad_on_error + fname + " failed (expected eval error).\n"); -  +  werror("Got %O\n", a);    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,testsuite)); +  o=compile_string(to_compile,testsuite)();    _dmalloc_set_name();       if(check > 1) _verify_internals();       a=b=0;    if(t) trace(t);    _dmalloc_set_name(fname,1);    if(functionp(o->a))    {    // trace(10);
pike.git/bin/test_pike.pike:860:    write( "%-10s: %6s %10d\n",    "Total", "", total );    }    }    if(errors || verbose>1)    {    werror("Failed tests: "+errors+".\n");    }       werror("Total tests: %d (%d tests skipped)\n",successes+errors,skipped); +  if(verbose) +  werror("Finished tests at "+ctime(time()));    -  + #if 1 +  if(verbose && sizeof(all_constants())!=sizeof(const_names)) { +  multiset const_names = (multiset)const_names; +  foreach(indices(all_constants()), string const) +  if( !const_names[const] ) +  werror("Leaked constant %O\n", const); +  } + #endif +    #ifdef WATCHDOG_SIGNAL    if(use_watchdog)    {    watchdog->kill(signum("SIGKILL"));    watchdog->wait();    }   #endif      #ifdef WATCHDOG_PIPE    if(use_watchdog)