| 1 |
set test speculate |
| 2 |
|
| 3 |
catch {exec gcc -g -o $test $srcdir/$subdir/$test.c} err |
| 4 |
if {$err == "" && [file exists $test]} then { pass "$test compile" } else { fail "$test compile" } |
| 5 |
|
| 6 |
set rc [stap_run_batch $srcdir/$subdir/$test.stp] |
| 7 |
if {$rc == 0} then { pass "$test -p4" } else { fail "$test -p4" } |
| 8 |
|
| 9 |
if {! [installtest_p]} { |
| 10 |
catch {exec rm -f $test} |
| 11 |
untested "$test -p5" |
| 12 |
return |
| 13 |
} |
| 14 |
|
| 15 |
spawn stap $srcdir/$subdir/$test.stp -c ./$test -w |
| 16 |
set ok 0 |
| 17 |
expect { |
| 18 |
-timeout 60 |
| 19 |
-re {^open[^\r\n]*\r\n} { incr ok; exp_continue } |
| 20 |
-re {^write[^\r\n]*\r\n} { incr ok; exp_continue } |
| 21 |
timeout { fail "$test (timeout)" } |
| 22 |
eof { } |
| 23 |
} |
| 24 |
catch { close } |
| 25 |
wait |
| 26 |
if {$ok == 4} then { pass "$test -p5" } else { fail "$test -p5 ($ok)" } |
| 27 |
exec rm -f $test |