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.40 2000/03/27 20:29:45 hubbe Exp $ */ + /* $Id: test_pike.pike,v 1.41 2000/03/29 04:52:50 hubbe 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:76:    {    case "testsuite":    case "module_testsuite":    ret+=({ combine_path(dir||"",file) });    }    }    }    return ret;   }    + // 20 minutes should be enough.. + #define WATCHDOG_TIMEOUT 60*20 +    #if constant(thread_create)   #define WATCHDOG   #define WATCHDOG_PIPE   object watchdog_pipe;   #else   #if constant(signal) && constant(signum)   #define WATCHDOG   #define WATCHDOG_SIGNAL   #endif   #endif         #ifdef WATCHDOG   object watchdog;   int use_watchdog=1; -  + int watchdog_time; +  + void signal_watchdog() + { + #ifdef WATCHDOG +  if(use_watchdog && time() - watchdog_time > 30) +  { +  watchdog_time=time(); + // werror("{WATCHDOG} Ping!\n"); + #ifdef WATCHDOG_PIPE +  watchdog_pipe->write("x",1);   #endif    -  + #ifdef WATCHDOG_SIGNAL +  watchdog->kill(signum("SIGQUIT")); + #endif +  } + #endif + } + #endif +    int main(int argc, string *argv)   {    int e, verbose, successes, errors, t, check;    int skipped;    string *tests,tmp;    program testprogram;    int start, fail, mem;    int loop=1;    int end=0x7fffffff;    string extra_info="";
pike.git/bin/test_pike.pike:189: Inside #if defined(WATCHDOG)
   while(1)    {    sleep(10);    if(exit_quietly) _exit(0);   #ifndef __NT__    if(!kill(pid, 0)) _exit(0);   #endif   // werror("[WATCHDOG] t=%d\n",time()-last_time);       /* I hope 30 minutes per test is enough for everybody */ -  if(time() - last_time > 60 * 30) +  if(time() - last_time > WATCHDOG_TIMEOUT)    {    werror("\n[WATCHDOG] Pike testsuite timeout, sending SIGABRT.\n");    kill(pid, signum("SIGABRT"));    for(int q=0;q<60;q++) if(!kill(pid,0)) _exit(0); else sleep(1);    werror("\n"    "[WATCHDOG] This is your friendly watchdog again...\n"    "[WATCHDOG] testsuite failed to die from SIGABRT, sending SIGKILL\n");    kill(pid, signum("SIGKILL"));    for(int q=0;q<60;q++) if(!kill(pid,0)) _exit(0); else sleep(1);    werror("\n"
pike.git/bin/test_pike.pike:282: Inside #if defined(WATCHDOG) and #if defined(WATCHDOG_PIPE)
   backtrace()[0][3] + ({ "--watchdog="+getpid() }),    (["stdin":watchdog_tmp ]));    destruct(watchdog_tmp);   #endif      #ifdef WATCHDOG_SIGNAL    watchdog=Process.create_process(    backtrace()[0][3] + ({ "--watchdog="+getpid() }) );   #endif    } +  add_constant("__signal_watchdog",signal_watchdog); + #else +  add_constant("__signal_watchdog",lambda(){});   #endif       argv=Getopt.get_args(argv,1)+testsuites;    if(sizeof(argv)<1)    {    if(!tmp)    {    werror("No tests?\n");    exit(1);    }
pike.git/bin/test_pike.pike:314:    }       tests=tmp/"\n....\n";    tmp=0;    tests=tests[0..sizeof(tests)-2];       werror("Doing tests in %s (%d tests)\n",argv[f],sizeof(tests));       for(e=start;e<sizeof(tests);e++)    { - #ifdef WATCHDOG -  if(use_watchdog && time() - watchdog_time > 30) -  { -  watchdog_time=time(); - // werror("{WATCHDOG} Ping!\n"); - #ifdef WATCHDOG_PIPE -  watchdog_pipe->write("x",1); - #endif +  signal_watchdog();    - #ifdef WATCHDOG_SIGNAL -  watchdog->kill(signum("SIGQUIT")); - #endif -  } - #endif -  -  +     int skip=0;    string test,condition;    string|int type;    object o;    mixed a,b;       if(check) _verify_internals();    if(check>3) {    gc();    _verify_internals();