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.
# 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.
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
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
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