summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorStan Cox <scox@redhat.com>2009-03-11 17:37:09 -0400
committerStan Cox <scox@redhat.com>2009-03-11 17:37:09 -0400
commite248aea9a04dd0d3c4e066afdca52176aaf9a536 (patch)
tree4f453a038665f040b283164a2e81099c7771c2d4 /testsuite
parent06ba5b2c104f5c1c613fdf9085897e56b0912209 (diff)
downloadsystemtap-steved-e248aea9a04dd0d3c4e066afdca52176aaf9a536.tar.gz
systemtap-steved-e248aea9a04dd0d3c4e066afdca52176aaf9a536.tar.xz
systemtap-steved-e248aea9a04dd0d3c4e066afdca52176aaf9a536.zip
Run the tests for each member of a list of extra options.
* testsuite/systemtap.base/sdt.h: Add extra_flags and g++ as a test language.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/systemtap.base/sdt.exp31
1 files changed, 30 insertions, 1 deletions
diff --git a/testsuite/systemtap.base/sdt.exp b/testsuite/systemtap.base/sdt.exp
index 9c40bf4d..09aaaf8d 100644
--- a/testsuite/systemtap.base/sdt.exp
+++ b/testsuite/systemtap.base/sdt.exp
@@ -10,13 +10,41 @@ set ::result_string {1
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9 10}
+set extra_flags {{""} {additional_flags=-ansi}}
+
+# Iterate extra_flags, trying each with C and C++
+for {set i 0} {$i < [llength $extra_flags]} {incr i} {
+# C
set test_flags "additional_flags=-g"
set test_flags "$test_flags additional_flags=-I$srcdir/../includes/sys"
set test_flags "$test_flags additional_flags=-std=gnu89"
set test_flags "$test_flags additional_flags=-Wall"
set test_flags "$test_flags additional_flags=-Wdeclaration-after-statement"
set test_flags "$test_flags additional_flags=-Werror"
-set res [target_compile $srcdir/$subdir/$test.c $test.prog executable $test_flags]
+
+set res [target_compile $srcdir/$subdir/$test.c $test.prog executable [concat $test_flags " " [lindex $extra_flags $i]]]
+if { $res != "" } {
+ verbose "target_compile failed: $res" 2
+ fail "compiling $test.c"
+ return
+} else {
+ pass "compiling $test.c"
+}
+
+if {[installtest_p]} {
+ stap_run2 $srcdir/$subdir/$test.stp -c ./$test.prog
+} else {
+ untested "$test"
+}
+
+# C++
+set test_flags "additional_flags=-g"
+set test_flags "$test_flags additional_flags=-I$srcdir/../includes/sys"
+set test_flags "$test_flags additional_flags=-Wall"
+set test_flags "$test_flags additional_flags=-Werror"
+set test_flags "$test_flags additional_flags=-x additional_flags=c++"
+
+set res [target_compile $srcdir/$subdir/$test.c $test.prog executable [concat $test_flags [lindex $extra_flags $i]]]
if { $res != "" } {
verbose "target_compile failed: $res" 2
fail "compiling $test.c"
@@ -30,5 +58,6 @@ if {[installtest_p]} {
} else {
untested "$test"
}
+}
catch {exec rm -f $test.prog}