Unified · Split
| @@ -29,7 +29,12 @@ CLEANFILES=\ · 28 unmodified lines | |||
| 29 | ftrace-test \ | 29 | ftrace-test \ |
| 30 | tests.log \ | 30 | tests.log \ |
| 31 | 31 | ||
| 32 | ftrace-test: all | 32 | TESTS=\ |
| 33 | ftrace-test \ | ||
| 34 | |||
| 35 | all:V: $LIB | ||
| 36 | |||
| 37 | ftrace-test: | ||
| 33 | $CC tests/ftrace-test.c | 38 | $CC tests/ftrace-test.c |
| 34 | $LD -o ftrace-test ftrace-test.$O | 39 | $LD -o ftrace-test ftrace-test.$O |
| 35 | 40 | ||
| @@ -38,13 +43,22 @@ installheaders: · 2 unmodified lines | |||
| 38 | cp $i /sys/include | 43 | cp $i /sys/include |
| 39 | } | 44 | } |
| 40 | 45 | ||
| 41 | run-tests: ftrace-test | 46 | run-tests:EVQ: ftrace-test |
| 42 | rm -f tests.log | 47 | echo 'running tests...' |
| 43 | ftrace-test >> tests.log >[2=1] | 48 | { |
| 49 | echo -n 'tests started at ' | ||
| 50 | date | ||
| 51 | echo '-----------------------------------------------------' | ||
| 52 | for(i in $TESTS){ | ||
| 53 | echo 'running test: '^$i | ||
| 54 | $i >[2=1] | ||
| 55 | echo '-----------------------------------------------------' | ||
| 56 | } | ||
| 57 | echo 'tests done.' | ||
| 58 | } > tests.log | ||
| 44 | 59 | ||
| 45 | </sys/src/cmd/mksyslib | 60 | </sys/src/cmd/mksyslib |
| 46 | 61 | ||
| 47 | nuke:V: | 62 | nuke:V: |
| 48 | rm -f *.[$OS] [$OS].out $CLEANFILES $LIB | 63 | rm -f *.[$OS] [$OS].out $CLEANFILES $LIB |
| 49 | 64 | ||
| 50 | all:V: $LIB | ||
| @@ -33,6 +33,8 @@ fn1(void) · 32 unmodified lines | |||
| 33 | Fn *f = infn("fn1"); | 33 | Fn *f = infn("fn1"); |
| 34 | iqlock(f,&g); | 34 | iqlock(f,&g); |
| 35 | if(rfork(RFPROC)==0){ | 35 | if(rfork(RFPROC)==0){ |
| 36 | if(!canqlock(&g)) | ||
| 37 | upanic(f,"some lock order garbage is happening"); | ||
| 36 | iqunlock(f,&g); | 38 | iqunlock(f,&g); |
| 37 | upanic(f,"penis"); | 39 | upanic(f,"penis"); |
| 38 | } | 40 | } |
| @@ -47,6 +49,8 @@ fn2(void) · 8 unmodified lines | |||
| 47 | if((x = rfork(RFPROC)) == 0){ | 49 | if((x = rfork(RFPROC)) == 0){ |
| 48 | Fn *f2 = infn("fn2@proc"); | 50 | Fn *f2 = infn("fn2@proc"); |
| 49 | fn1(); | 51 | fn1(); |
| 52 | action(f,smprint("exiting pid = %d",getpid())); | ||
| 53 | exits("error: success"); | ||
| 50 | outfn(f2); | 54 | outfn(f2); |
| 51 | } else if(x == -1){ | 55 | } else if(x == -1){ |
| 52 | char *s = mallocz(sizeof(char)*1024,1); | 56 | char *s = mallocz(sizeof(char)*1024,1); |