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.37 2000/03/07 08:14:57 hubbe Exp $ */ + /* $Id: test_pike.pike,v 1.38 2000/03/20 20:57:34 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:174: Inside #if defined(WATCHDOG) and #if defined(WATCHDOG_SIGNAL)
   });    }else{    exit(1);    }   #endif   // werror("[WATCHDOG] started, watching %d.\n",pid);       while(1)    {    sleep(10); -  if(exit_quietly) exit(0); +  if(exit_quietly) _exit(0);   #ifndef __NT__ -  if(!kill(pid, 0)) exit(0); +  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)    {    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); +  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); +  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] SIGKILL, SIGKILL, SIGKILL, DIE!\n");    kill(pid, signum("SIGKILL"));    kill(pid, signum("SIGKILL"));    kill(pid, signum("SIGKILL"));    kill(pid, signum("SIGKILL")); -  for(int q=0;q<60;q++) if(!kill(pid,0)) exit(0); else sleep(1); +  for(int q=0;q<60;q++) if(!kill(pid,0)) _exit(0); else sleep(1);    werror("\n"    "[WATCHDOG] Giving up, must be a device wait.. :(\n"); -  exit(0); +  _exit(0);    }    }   #else -  exit(1); +  _exit(1);   #endif    break;       case "notty":    istty_cache=-1;    break;       case "help":    werror("Usage: "+argv[e]+" [-v | --verbose] [-h | --help] [-t <testno>] <testfile>\n");    return 0;
pike.git/bin/test_pike.pike:634:    }    if(errors || verbose)    {    werror("Failed tests: "+errors+".\n");    }       werror("Total tests: %d (%d tests skipped)\n",successes+errors,skipped);      #ifdef WATCHDOG_SIGNAL    if(use_watchdog) +  {    watchdog->kill(signum("SIGKILL")); -  +  watchdog->wait(); +  }   #endif    -  + #ifdef WATCHDOG_PIPE +  if(use_watchdog) +  { +  destruct(watchdog_pipe); + #if constant(signum) +  catch { watchdog->kill(signum("SIGKILL")); }; + #endif +  watchdog->wait(); +  } + #endif +     return errors;   }