pike.git / bin / test_pike.pike

version» Context lines:

pike.git/bin/test_pike.pike:1:   #! /usr/bin/env pike    - /* $Id: test_pike.pike,v 1.104 2004/08/31 13:55:45 grubba Exp $ */ + /* $Id: test_pike.pike,v 1.105 2004/08/31 15:54:22 grubba Exp $ */      #if !constant(_verify_internals)   #define _verify_internals()   #endif      #if !constant(_dmalloc_set_name)   void _dmalloc_set_name(mixed ... args) {}   #endif      int foo(string opt)
pike.git/bin/test_pike.pike:390:    if (mem) forked += ({ "--memory" });    // auto already handled.    if (all_constants()->regression) forked += ({ "--regression" });    // debug port not propagated.    //werror("forked:%O\n", forked);    }       // Move stdout to a higher fd, so that close on exec works.    // This makes sure the original stdout gets closed even if    // some subprocess hangs. -  Stdio.File stdout = Stdio.stdout->dup(); +  Stdio.File stdout = Stdio.File(); +  Stdio.stdout->dup2(stdout); +  //stdout->assign(Stdio.stdout->_fd->dup());    Stdio.stderr->dup2(Stdio.stdout);    stdout->set_close_on_exec(1);    -  add_constant("_verbose", verbose); -  if(verbose) -  stdout->write("Begin tests at "+ctime(time())); -  +    #ifdef WATCHDOG    int watchdog_time=time();       if(use_watchdog && !forked)    {   #ifdef WATCHDOG_PIPE    object watchdog_tmp=Stdio.File();    watchdog_pipe=watchdog_tmp->pipe(Stdio.PROP_IPC);    watchdog=Process.create_process(    backtrace()[0][3] + ({ "--watchdog="+getpid() }),
pike.git/bin/test_pike.pike:422: Inside #if defined(WATCHDOG) and #if defined(WATCHDOG_SIGNAL)
  #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 // else WATCHDOG_PIPE    +  add_constant("_verbose", verbose); +  if(verbose) +  stdout->write("Begin tests at "+ctime(time())); +     testsuites += Getopt.get_args(argv, 1)[1..];    foreach(testsuites; int pos; string ts) {    if(Stdio.is_dir(ts))    testsuites[pos] = ts = combine_path(ts, "testsuite");    if(!file_stat(ts))    exit(1, "Could not find test %O.\n", ts);    }       if(!sizeof(testsuites))    exit(1, "No tests found. Use --help for more information.\n");
pike.git/bin/test_pike.pike:466:    string results = lower_case(raw_results = p->read());    int err = pid->wait();    int total = 0;    int failed = 0;    int skip = 0;    if (((sscanf(results, "%*sfailed tests:%d", failed) != 2) +    (sscanf(results, "%*stotal tests:%d", total) != 2) +    (sscanf(results, "%*s(%d tests skipped)", skip) != 2)) == 3) {    // Failed to parse the result totally.    werror("Failed to parse subresult for testsuite %O (exitcode:%d):\n" -  "%s", testsuite, err, raw_results); +  "%O", testsuite, err, raw_results);    errors++;    } else {    werror("Subresult: %d tests, %d failed, %d skipped\n",    total, failed, skip);    errors += failed;    successes += total - failed;    skipped += skip;    }    if (fail && errors) {    exit(1);