pike.git / src / testsuite.in

version» Context lines:

pike.git/src/testsuite.in:1: - test_true([["$Id: testsuite.in,v 1.611 2003/03/01 14:24:25 nilsson Exp $"]]); + test_true([["$Id: testsuite.in,v 1.612 2003/03/01 16:33:34 grubba Exp $"]]);      // This triggered a bug only if run sufficiently early.   test_compile_any([[#pike 7.2]])      cond([[all_constants()->_verify_internals]],   [[    test_do(_verify_internals())   ]]);   test_eq(1e1,10.0);   test_eq(1E1,10.0);
pike.git/src/testsuite.in:8939:   ]],[[ ({}) ]])      test_do([[    object proc = Process.create_process (({"/bin/sleep", "99999"}));    array threads = allocate (10, Thread.thread_create) (    lambda (object proc) {proc->wait();}, proc);    sleep (1);    proc->kill (9);    return threads->wait() - ({-1});   ]], ({})) + ]])    -  + cond([[ file_stat("/bin/sleep") && __builtin->TraceProcess && (cpp("__NT__")/"\n")[1]=="__NT__" ]], + [[   test_do([[    // Check that tracing works... -  object proc = Process.create_process(({ "/bin/sleep", "99999" }), -  (["trace":1])); -  if (!proc->continue) { -  // No trace support... -  proc->kill(9); -  return 0; -  } -  int code = proc->wait(1); +  Process.TraceProcess proc = +  Process.TraceProcess(({ "/bin/sleep", "99999" })); +  +  int code = proc->wait();    if (code != -2) {    proc->kill(9);    return sprintf("Bad returncode from wait():%d (expected -2)", code);    }    int sig = proc->last_signal();    if (sig != 5) {    proc->kill(9);    return sprintf("Unexpected signal:%d (expected 5)", sig);    } -  proc->continue(); +  proc->cont();       // Check that we can block deadly signals.    proc->kill(15); // SIGTERM -  code = proc->wait(1); +  code = proc->wait();    if (code != -2) {    proc->kill(9);    return sprintf("Bad second returncode from wait():%d (expected -2)", code);    }    sig = proc->last_signal();    if (sig != 15) {    proc->kill(9);    return sprintf("Unexpected signal:%d (expected 15)", sig);    } -  proc->continue(); +  proc->cont();       // Check that we can make harmless signals deadly.    proc->kill(18); // SIGCONT -  code = proc->wait(1); +  code = proc->wait();    if (code != -2) {    proc->kill(9);    return sprintf("Bad third returncode from wait():%d (expected -2)", code);    }    sig = proc->last_signal();    if (sig != 18) {    proc->kill(9);    return sprintf("Unexpected signal:%d (expected 18)", sig);    } -  proc->continue(9); // Make it a SIGKILL +  proc->cont(9); // Make it a SIGKILL    -  code = proc->wait(1); +  code = proc->wait();    if (code != -1) {    proc->kill(9);    return sprintf("Bad fourth returncode from wait():%d (expected -1)", code);    }    sig = proc->last_signal();    if (sig != 9) {    proc->kill(9);    return sprintf("Unexpected signal:%d (expected 9)", sig);    }    // Test ok.