pike.git / lib / modules / testsuite.in

version» Context lines:

pike.git/lib/modules/testsuite.in:1: - dnl $Id: testsuite.in,v 1.16 2003/08/10 19:25:28 nilsson Exp $ + dnl $Id: testsuite.in,v 1.17 2003/10/04 18:18:23 grubba Exp $      dnl - Array      test_equal(Array.diff(({ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }),    ({ 6, 7, 8, 9, 3, 4, 5, 1, 2, 0 })),    ({ ({ ({ 0, 1, 2, 3, 4, 5 }),    ({ 6, 7, 8, 9 }), ({}) }),    ({ ({}), ({ 6, 7, 8, 9 }),    ({ 3, 4, 5, 1, 2, 0 }) }) }))   test_equal(Array.diff(({ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }),
pike.git/lib/modules/testsuite.in:695:   test_any([[object o=Stdio.File(); object o2=o->pipe(); object p=Process.create_process(Process.split_quoted_string(RUNPIKE)+({"-e","exit(Stdio.File(\"stdin\")->read(1000)==\"hello\")"}),(["stdin":o])); o2->write("hello"); destruct(o); destruct(o2); return p->wait()]],1)   test_any([[object o=Stdio.File(); object o2=o->pipe(Stdio.PROP_IPC); object p=Process.create_process(Process.split_quoted_string(RUNPIKE)+({"-e","exit(Stdio.stdin->read(1000)==\"hello\")"}),(["stdin":o])); o2->write("hello"); destruct(o); destruct(o2); return p->wait()]],1)   test_any([[object o=Stdio.File(); object o2=o->pipe(Stdio.PROP_BIDIRECTIONAL); object p=Process.create_process(Process.split_quoted_string(RUNPIKE)+({"-e","exit(Stdio.stdin->read(1000)==\"hello\")"}),(["stdin":o2])); o->write("hello"); destruct(o); destruct(o2); return p->wait()]],1)      cond([[ file_stat("/bin/cat") && file_stat("/dev/null") && (cpp("__NT__")/"\n")[1]=="__NT__" ]],   [[    test_false(Process.create_process(({"/bin/cat","/dev/null"}))->wait());    test_false(Process.create_process(({"/bin/cat","/dev/null"}))->wait());    test_false(Process.create_process(({"/bin/cat","/dev/null"}))->wait());    +  test_do(_gdb_breakpoint();) +     test_any([[    object o=Process.create_process(({"/bin/cat","/dev/null"}));    if(Process.create_process(({"/bin/cat","/dev/null"}))->wait()) return 99;    sleep(1);    return kill(o->pid(), 9);    ]],0);       dnl Some OSs have a delay before PIDs are reused.    dnl Be nice, and let them reuse some.    test_do([[ sleep(2); ]]);
pike.git/lib/modules/testsuite.in:792:   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__" ]], + cond([[ file_stat("/bin/cat") && __builtin->TraceProcess && (cpp("__NT__")/"\n")[1]=="__NT__" ]],   [[   test_any([[    // Check that tracing works... -  // Use a spawned pike to make sure the process doesn't exit -  // prematurely due to EINTR. +  // Spawn a /bin/cat that hangs on a read from a pipe connected to +  // this process, so that it will die of SIGPIPE if we die. +  Stdio.File input_fd = Stdio.File();    Process.TraceProcess proc = -  Process.TraceProcess(RUNPIKE_ARRAY + ({ "-e", "sleep(99999)" })); +  Process.TraceProcess(({ "/bin/cat" }), ([ +  "stdin":input_fd->pipe(), +  ]));       int initial_sleep = 5;    int count;    int state;    int code;    while (((code = proc->wait()) == -2) && (count++ < 20)) {    int sig = proc->last_signal();    switch(sig) {    case signum("TRAP"):    if (state) {