* testsuite/systemtap.syscall/syscall.exp: Compile the module once.
* testsuite/systemtap.syscall/nd_syscall.exp: Ditto.
* testsuite/systemtap.syscall/test.tcl (run_one_test): Use staprun to load
the previously compiled module.
set test_script "nd_sys.stp"
+set test_module_name "nd_syscall"
+set wd [pwd]
+set test_module "${wd}/${test_module_name}.ko"
+
source $srcdir/$subdir/test.tcl
proc test_procedure {} {
- global srcdir subdir
+ global srcdir subdir test_script test_module test_module_name
set wd [pwd]
set flags ""
if {$srcdir == ""} {
set pattern "$srcdir/$subdir/*.c"
}
+ # To speed things up, go ahead and compile the test module once
+ # here, then just use it down in run_one_test(). The test script
+ # uses wildcards to cover every syscall and takes time to parse.
+ set script "$srcdir/$subdir/${test_script}"
+ set cmd "stap -p4 -m ${test_module_name} --skip-badvars ${script}"
+ exec /bin/rm -f ${test_module}
+ catch {eval exec $cmd} output
+ send_log $output
+ if {[file exists ${test_module}]} {
+ pass "${script} compilation"
+ } else {
+ # If compiling the test module failed, there isn't much point
+ # in trying to run any of the real tests.
+ fail "${script} compilation"
+ return
+ }
+
# for first pass, force 64-bit compilation for 64-bit systems
# Add any other 64-bit arcvhitecture you want tested below.
# To find tcl's platform name for your machine, run the following:
run_one_test $filename $flags 32 "nd_syscall"
}
}
+
+ # Cleeanup
+ exec /bin/rm -f ${test_module}
}
test_procedure
set test_script "sys.stp"
+set test_module_name "syscall"
+set wd [pwd]
+set test_module "${wd}/${test_module_name}.ko"
+
source $srcdir/$subdir/test.tcl
proc test_procedure {} {
- global srcdir subdir
- set wd [pwd]
+ global srcdir subdir test_script test_module test_module_name
set flags ""
if {$srcdir == ""} {
set pattern "*.c"
set pattern "$srcdir/$subdir/*.c"
}
+ # To speed things up, go ahead and compile the test module once
+ # here, then just use it down in run_one_test(). The test script
+ # uses wildcards to cover every syscall and takes time to parse.
+ set script "$srcdir/$subdir/${test_script}"
+ set cmd "stap -p4 -m ${test_module_name} --skip-badvars ${script}"
+ exec /bin/rm -f ${test_module}
+ catch {eval exec $cmd} output
+ send_log $output
+ if {[file exists ${test_module}]} {
+ pass "${script} compilation"
+ } else {
+ # If compiling the test module failed, there isn't much point
+ # in trying to run any of the real tests.
+ fail "${script} compilation"
+ return
+ }
+
# for first pass, force 64-bit compilation for 64-bit systems
# Add any other 64-bit arcvhitecture you want tested below.
# To find tcl's platform name for your machine, run the following:
run_one_test $filename $flags 32 "syscall"
}
}
+
+ # Cleeanup
+ exec /bin/rm -f ${test_module}
}
test_procedure
trap {syscall_cleanup_and_exit} SIGINT
proc run_one_test {filename flags bits suite} {
- global syscall_dir current_dir test_script
+ global syscall_dir current_dir test_module
set testname [file tail [string range $filename 0 end-2]]
return
}
- set sys_prog "[file dirname [file normalize $filename]]/${test_script}"
- set cmd "stap --skip-badvars -c $syscall_dir/${testname} ${sys_prog}"
+ set cmd "staprun ${test_module} -c $syscall_dir/${testname}"
# Extract additional C flags needed to compile
set add_flags ""