diff options
author | hunt <hunt> | 2007-07-03 21:38:40 +0000 |
---|---|---|
committer | hunt <hunt> | 2007-07-03 21:38:40 +0000 |
commit | d1cd4267e903d8bb0190e96e572ed42fcd0b25d1 (patch) | |
tree | 2cace504d870b54c24036001743847985a2fd125 /testsuite/systemtap.context/context.exp | |
parent | 9c94117be7020cbd66563e49ca22e8680145a90a (diff) | |
download | systemtap-steved-d1cd4267e903d8bb0190e96e572ed42fcd0b25d1.tar.gz systemtap-steved-d1cd4267e903d8bb0190e96e572ed42fcd0b25d1.tar.xz systemtap-steved-d1cd4267e903d8bb0190e96e572ed42fcd0b25d1.zip |
2007-07-03 Martin Hunt <hunt@redhat.com>
* systemtap.context/pid.tcl: Better error reporting.
* systemtap.context/args.*: Ditto.
* systemtap.context/context.exp: Build in temp dir.
Diffstat (limited to 'testsuite/systemtap.context/context.exp')
-rw-r--r-- | testsuite/systemtap.context/context.exp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/testsuite/systemtap.context/context.exp b/testsuite/systemtap.context/context.exp index 858596d9..4f134740 100644 --- a/testsuite/systemtap.context/context.exp +++ b/testsuite/systemtap.context/context.exp @@ -7,34 +7,55 @@ if {![installtest_p]} { return } +set build_dir "" + proc cleanup {} { + global build_dir catch {send "\003"} foreach n {1 2} { catch {exec sudo /bin/rm -f /lib/modules/$::uname/systemtap_test_module$n.ko} catch {exec sudo /sbin/rmmod systemtap_test_module$n} } + if {$build_dir != ""} {exec rm -rf $build_dir} } proc build_modules {} { + global build_dir + + if {[catch {exec mktemp -d staptestXXXXX} build_dir]} { + puts stderr "Failed to create temporary directory: $build_dir" + return 0 + } + + foreach f [glob systemtap_test_module*.c] { + exec cp $f $build_dir + } + set old_dir [pwd] + cd $build_dir + foreach n {1 2} { - exec cp makefile$n Makefile + exec cp $old_dir/makefile$n Makefile if {[catch {exec make clean} res]} { puts $res + cd $old_dir return 0 } catch {exec make} res if {![file exists systemtap_test_module$n.ko]} { puts $res + cd $old_dir return 0 } if {[catch {exec sudo cp systemtap_test_module$n.ko /lib/modules/$::uname} res]} { puts $res + cd $old_dir return 0 } } foreach n {2 1} { catch {exec sudo /sbin/insmod systemtap_test_module$n.ko} } + cd $old_dir return 1 } |