1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
set test "java"
if {[catch { exec which javac } res]} {
untested "$test - no javac"
return
}
if {! [installtest_p]} then { untested $test; return }
if {! [java_p]} then { untested $test; return }
set test "multiparams"
verbose -log "javac -d ./ $srcdir/$subdir/multiparams.java"
catch { exec javac -d ./ $srcdir/$subdir/multiparams.java } err2
if {$err2 == "" && [file exists ./multiparams.class]} then { pass "$test compile" } else { fail "$test compile $err2" }
# spawn stap --vp 00002 $srcdir/$subdir/multiparams.stp -c "java -Djava.library.path=$env(PKGLIBDIR) -classpath $env(PKGLIBDIR)/HelperSDT.jar:. multiparams 2>&1"
spawn stap $srcdir/$subdir/multiparams.stp -c "java -Djava.library.path=$env(PKGLIBDIR) -classpath $env(PKGLIBDIR)/HelperSDT.jar:. multiparams 2>&1"
set okb 0
expect {
-timeout 80
-re {java[^\r\n]*just a multiparams hello 14 a true 10 2.71828 3.14159265359 254775806 42\r\n} { incr okb; exp_continue }
-re {java[^\r\n]*.null. hello 14 a true 10 2.71828 3.14159265359 254775806 42\r\n} { incr okb; exp_continue }
-re {java.lang.Throwable[^\r\n]*\r\n} { incr okb; exp_continue }
-re {multiparams.main[^\r\n]*\r\n} { incr okb; exp_continue }
timeout { fail "$test unexpected timeout" }
}
if {$okb > 3} then {
pass "$test ($okb)"
catch {exec rm ./multiparams.class}
} else {
fail "$test ($okb)"
}
catch {close}; catch {wait}
set test "multiparams 3.0"
verbose -log "javac -d ./ $srcdir/$subdir/multiparams.java"
catch { exec javac -d ./ $srcdir/$subdir/multiparams.java } err2
if {$err2 == "" && [file exists ./multiparams.class]} then { pass "$test compile" } else { fail "$test compile $err2" }
spawn stap --compatible=3.0 $srcdir/$subdir/multiparams.stp -c "java -Djava.library.path=$env(PKGLIBDIR) -classpath $env(PKGLIBDIR)/HelperSDT.jar:. multiparams 2>&1"
# spawn stap --vp 00002 --compatible=3.0 $srcdir/$subdir/multiparams.stp -c "java -Djava.library.path=$env(PKGLIBDIR) -classpath $env(PKGLIBDIR)/HelperSDT.jar:. multiparams 2>&1"
set okb 0
expect {
-timeout 80
-re {java[^\r\n]*"just a multiparams" "hello" 14 97 1 10 2 3 254775806 42\r\n} { incr okb; exp_continue }
-re {java.lang.Throwable[^\r\n]*\r\n} { incr okb; exp_continue }
-re {multiparams.main[^\r\n]*\r\n} { incr okb; exp_continue }
timeout { fail "$test unexpected timeout" }
}
if {$okb} then {
pass "$test ($okb)"
catch {exec rm ./multiparams.class}
} else {
fail "$test ($okb)"
}
catch {close}; catch {wait}
|