]> sourceware.org Git - systemtap.git/commitdiff
testsuite: Fix pretty-bits/char to work with relative paths
authorJosh Stone <jistone@redhat.com>
Thu, 7 Jun 2012 20:46:38 +0000 (13:46 -0700)
committerJosh Stone <jistone@redhat.com>
Thu, 7 Jun 2012 20:55:28 +0000 (13:55 -0700)
This is more fallout from the automake update (commit c66be968a4ea)
which led to relative $srcdir.  The pretty-bits and pretty-char tests
are passing $srcdir headers to @cast kernel types.  That gets compiled
with Kbuild, with the working directory is changed to the kernel root,
so we need to give full paths for those headers.

This adds a new tcl proc "fullpath" which inserts [pwd]/ on relative
paths, and updates those pretty tests to use it.

testsuite/lib/systemtap.exp
testsuite/systemtap.printf/pretty-bits.exp
testsuite/systemtap.printf/pretty-char.exp

index 561530bb95f2050d3a07a624985c03aec5fd95f0..7d2c0dfdbe894ce5e34f8205bf378753eb727eb2 100644 (file)
@@ -93,11 +93,7 @@ proc setup_systemtap_environment {} {
 
     # need an absolute SRCDIR for the top-level src/ tree
     # XXX: or, we could change nearby uses of ${SRCDIR}/testsuite to ${SRCDIR}
-    if {[string index $srcdir 0] != "/"} then {
-        set env(SRCDIR) [exec pwd]/$srcdir/..
-    } else {
-        set env(SRCDIR) $srcdir/..
-    }
+    set env(SRCDIR) [fullpath $srcdir/..]
 
     # Use a local systemtap directory and cache.  Add user name so
     # make check and sudo make check don't clobber each other.
@@ -250,6 +246,15 @@ proc normalize_arch { arch } {
     return $arch
 }
 
+proc fullpath { path } {
+    if {[string index $path 0] != "/"} then {
+        # relative paths are anchored to the current directory
+        return [pwd]/$path
+    } else {
+        return $path
+    }
+}
+
 proc get_system_info {} {
     global Host Snapshot Distro GCC_Version env
 
index 0fd900414133fd155dfdea3ae03d1ad1a50fee2b..9aa00f0b1739c4277d02a44cc8f4ba7a41153690 100644 (file)
@@ -2,7 +2,7 @@ set test "pretty-bits"
 set ::result_string {{.a=0, .b=1, .c=1, .d=2, .e=3, .f=5, .g=8, .h=13}}
 
 set script $srcdir/$subdir/$test.stp
-set header $srcdir/$subdir/$test.h
+set header [fullpath $srcdir/$subdir/$test.h]
 
 stap_run2 $script kernel<$header> -g
 stap_run2 $script kernel<$header> -g -DSTP_LEGACY_PRINT
index bb09009a0cba850b296599dee6c8054d001114b1..80aa6159511d063245e4ee3950d9ca02a3a4fdb4 100644 (file)
@@ -2,7 +2,7 @@ set test "pretty-char"
 set ::result_string {{.a='A', .b='\000', .c='\b', .d='\354', .e='z'}}
 
 set script $srcdir/$subdir/$test.stp
-set header $srcdir/$subdir/$test.h
+set header [fullpath $srcdir/$subdir/$test.h]
 
 stap_run2 $script kernel<$header> -g
 stap_run2 $script kernel<$header> -g -DSTP_LEGACY_PRINT
This page took 0.031918 seconds and 5 git commands to generate.