qa: various fix to tests

This commit is contained in:
2017-08-11 02:01:55 +02:00
parent 93dde48355
commit 1c4a04cd30
21 changed files with 253 additions and 60 deletions

View File

@ -34,7 +34,7 @@ handletimeout(void *v, char *s)
if(strcmp(s, "timedout") == 0){
if(verbose)
print("%d: noted: %s\n", getpid(), s);
print("FAIL: timedout\n");
print("FAIL: %s timedout\n", argv0);
exits("FAIL");
}
return 0;
@ -71,11 +71,14 @@ stopAllAfter(int seconds)
}
void
main(void)
main(int argc, char* argv[])
{
int s, w;
rfork(RFNOTEG);
ARGBEGIN{
}ARGEND;
rfork(RFNOTEG|RFREND);
if (!atnotify(handletimeout, 1)){
fprint(2, "%r\n");
exits("atnotify fails");
@ -88,8 +91,8 @@ main(void)
switch((s = rfork(RFMEM|RFPROC|RFNOWAIT)))
{
case 0:
ready = 1;
qlock(&l);
ready = 1;
rsleep(&r);
qunlock(&l);
exits(nil);
@ -109,8 +112,8 @@ main(void)
case 0:
qlock(&l);
rwakeup(&r);
ready = 2;
qunlock(&l);
ready = 2;
exits(nil);
break;
case -1:
@ -137,6 +140,6 @@ main(void)
write(s, "kill", 5);
close(s);
}
print("FAIL");
print("FAIL\n");
exits("FAIL");
}