From c18b2f69080486db2b2591308ace672bdb1fe123 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Mon, 9 Mar 2009 11:03:55 +0100 Subject: Add new sdt.exp testcase. * testsuite/systemtap.base/sdt.exp: New test file. * testsuite/systemtap.base/sdt.stp: Likewise. * testsuite/systemtap.base/sdt.c: Likewise. --- testsuite/systemtap.base/sdt.exp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 testsuite/systemtap.base/sdt.exp (limited to 'testsuite/systemtap.base/sdt.exp') diff --git a/testsuite/systemtap.base/sdt.exp b/testsuite/systemtap.base/sdt.exp new file mode 100644 index 00000000..ce6b9a71 --- /dev/null +++ b/testsuite/systemtap.base/sdt.exp @@ -0,0 +1,36 @@ +set test "sdt" +set ::result_string {1 +1 2 +1 2 3 +1 2 3 4 +1 2 3 4 5 +1 2 3 4 5 6 +1 2 3 4 5 6 7 +1 2 3 4 5 6 7 8 +1 2 3 4 5 6 7 8 9 +1 2 3 4 5 6 7 8 9 10} + +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] +if { $res != "" } { + verbose "target_compile failed: $res" 2 + fail "compiling $test.c" + return +} else { + pass "compiling $test.c" +} + +# Currently fails for any mark probe with more than 4 arguments. +# FIXME - PR s/false/{![installtest_p]/ +if (0) { + stap_run2 $srcdir/$subdir/$test.stp -c ./$test.prog +} else { + untested "$test" +} + +catch {exec rm -f $test.prog} -- cgit From df5d1ba4cd009ba39f1bbe9466ae0f1a4e250a67 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Mon, 9 Mar 2009 12:55:46 +0100 Subject: Add PR9935 number to sdt.exp disabled test. --- testsuite/systemtap.base/sdt.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'testsuite/systemtap.base/sdt.exp') diff --git a/testsuite/systemtap.base/sdt.exp b/testsuite/systemtap.base/sdt.exp index ce6b9a71..71fe9dac 100644 --- a/testsuite/systemtap.base/sdt.exp +++ b/testsuite/systemtap.base/sdt.exp @@ -26,7 +26,7 @@ if { $res != "" } { } # Currently fails for any mark probe with more than 4 arguments. -# FIXME - PR s/false/{![installtest_p]/ +# FIXME - PR9935 s/(0)/{![installtest_p]}/ if (0) { stap_run2 $srcdir/$subdir/$test.stp -c ./$test.prog } else { -- cgit From fd0143174d30451c99fde61d719d2eaa53730ff6 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Mon, 9 Mar 2009 16:48:13 +0100 Subject: PR9935. Fixed stap script typos. arg[5-10] -> $arg[5-10]. * testsuite/systemtap.base/sdt.exp: Enable stap_run2 when installtest_p. * testsuite/systemtap.base/sdt.stp: Fixed all arg to $arg typos. --- testsuite/systemtap.base/sdt.exp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'testsuite/systemtap.base/sdt.exp') diff --git a/testsuite/systemtap.base/sdt.exp b/testsuite/systemtap.base/sdt.exp index 71fe9dac..9c40bf4d 100644 --- a/testsuite/systemtap.base/sdt.exp +++ b/testsuite/systemtap.base/sdt.exp @@ -25,9 +25,7 @@ if { $res != "" } { pass "compiling $test.c" } -# Currently fails for any mark probe with more than 4 arguments. -# FIXME - PR9935 s/(0)/{![installtest_p]}/ -if (0) { +if {[installtest_p]} { stap_run2 $srcdir/$subdir/$test.stp -c ./$test.prog } else { untested "$test" -- cgit From e248aea9a04dd0d3c4e066afdca52176aaf9a536 Mon Sep 17 00:00:00 2001 From: Stan Cox Date: Wed, 11 Mar 2009 17:37:09 -0400 Subject: 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. --- testsuite/systemtap.base/sdt.exp | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'testsuite/systemtap.base/sdt.exp') 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} -- cgit From ec80b3969d33e4d54e97ead4286bdb018e2f1f97 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Wed, 11 Mar 2009 22:11:09 -0400 Subject: improve sdt.h compatibility and test suite Replaced cpp VA_ARGS in sdt.h with explicit enumeration of arguments (since with -pedantic, cpp has no varargs), and added a few more cflags variants to the sdt.exp test case. --- testsuite/systemtap.base/sdt.exp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'testsuite/systemtap.base/sdt.exp') diff --git a/testsuite/systemtap.base/sdt.exp b/testsuite/systemtap.base/sdt.exp index 09aaaf8d..74818beb 100644 --- a/testsuite/systemtap.base/sdt.exp +++ b/testsuite/systemtap.base/sdt.exp @@ -10,31 +10,33 @@ 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}} +set extra_flags {{""} {additional_flags=-std=gnu89} {additional_flags=-ansi} {additional_flags=-pedantic}} # Iterate extra_flags, trying each with C and C++ for {set i 0} {$i < [llength $extra_flags]} {incr i} { +set extra_flag [lindex $extra_flags $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=-Wextra" set test_flags "$test_flags additional_flags=-Werror" -set res [target_compile $srcdir/$subdir/$test.c $test.prog executable [concat $test_flags " " [lindex $extra_flags $i]]] +set res [target_compile $srcdir/$subdir/$test.c $test.prog executable "$test_flags $extra_flag"] if { $res != "" } { verbose "target_compile failed: $res" 2 - fail "compiling $test.c" + fail "compiling $test.c $extra_flag" return } else { - pass "compiling $test.c" + pass "compiling $test.c $extra_flag" } if {[installtest_p]} { +# XXX: we need distinct test names for these stap_run2 $srcdir/$subdir/$test.stp -c ./$test.prog } else { - untested "$test" + untested "$test $extra_flag" } # C++ @@ -44,19 +46,20 @@ 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]]] +set res [target_compile $srcdir/$subdir/$test.c $test.prog executable "$test_flags $extra_flag"] if { $res != "" } { verbose "target_compile failed: $res" 2 - fail "compiling $test.c" + fail "compiling $test.c c++ $extra_flag" return } else { - pass "compiling $test.c" + pass "compiling $test.c c++ $extra_flag" } if {[installtest_p]} { +# XXX: we need distinct test names for these stap_run2 $srcdir/$subdir/$test.stp -c ./$test.prog } else { - untested "$test" + untested "$test c++ $extra_flag" } } -- cgit From fafd79e3a65854c8e7b3c0048e044af9741a0fff Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Fri, 13 Mar 2009 14:44:54 +0100 Subject: Introduce stap_run3 for distinct test names. * testsuite/lib/stap_run2.exp: Add stap_run3, called from stap_run2. * testsuite/systemtap.base/sdt.exp: Use stap_run3, for distinct test names. --- testsuite/systemtap.base/sdt.exp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'testsuite/systemtap.base/sdt.exp') diff --git a/testsuite/systemtap.base/sdt.exp b/testsuite/systemtap.base/sdt.exp index 74818beb..9e5dfc37 100644 --- a/testsuite/systemtap.base/sdt.exp +++ b/testsuite/systemtap.base/sdt.exp @@ -33,8 +33,7 @@ if { $res != "" } { } if {[installtest_p]} { -# XXX: we need distinct test names for these - stap_run2 $srcdir/$subdir/$test.stp -c ./$test.prog + stap_run3 "$test $extra_flag" $srcdir/$subdir/$test.stp -c ./$test.prog } else { untested "$test $extra_flag" } @@ -56,8 +55,7 @@ if { $res != "" } { } if {[installtest_p]} { -# XXX: we need distinct test names for these - stap_run2 $srcdir/$subdir/$test.stp -c ./$test.prog + stap_run3 "$test c++ $extra_flag" $srcdir/$subdir/$test.stp -c ./$test.prog } else { untested "$test c++ $extra_flag" } -- cgit From b16858f1452b4f111beb80875a5967dc8dff30fe Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Fri, 13 Mar 2009 14:49:55 +0100 Subject: Add -O2 and -O3 as extra test flags to sdt. * testsuite/systemtap.base/sdt.exp: Add -O2, -O3. --- testsuite/systemtap.base/sdt.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'testsuite/systemtap.base/sdt.exp') diff --git a/testsuite/systemtap.base/sdt.exp b/testsuite/systemtap.base/sdt.exp index 9e5dfc37..a0220202 100644 --- a/testsuite/systemtap.base/sdt.exp +++ b/testsuite/systemtap.base/sdt.exp @@ -10,7 +10,7 @@ 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=-std=gnu89} {additional_flags=-ansi} {additional_flags=-pedantic}} +set extra_flags {{""} {additional_flags=-std=gnu89} {additional_flags=-ansi} {additional_flags=-pedantic} {additional_flags=-O2} {additional_flags="-O3"}} # Iterate extra_flags, trying each with C and C++ for {set i 0} {$i < [llength $extra_flags]} {incr i} { -- cgit From 2497c78e8aa704366683dad56fc8d749a5e92f52 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Fri, 13 Mar 2009 14:54:26 +0100 Subject: Add -ansi -pedantic pair to sdt test. * testsuite/systemtap.base/sdt.exp: Add additional_flags -ansi together with -pedantic. --- testsuite/systemtap.base/sdt.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'testsuite/systemtap.base/sdt.exp') diff --git a/testsuite/systemtap.base/sdt.exp b/testsuite/systemtap.base/sdt.exp index a0220202..21b94810 100644 --- a/testsuite/systemtap.base/sdt.exp +++ b/testsuite/systemtap.base/sdt.exp @@ -10,7 +10,7 @@ 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=-std=gnu89} {additional_flags=-ansi} {additional_flags=-pedantic} {additional_flags=-O2} {additional_flags="-O3"}} +set extra_flags {{""} {additional_flags=-std=gnu89} {additional_flags=-ansi} {additional_flags=-pedantic} {additional_flags=-ansi additional_flags=-pedantic} {additional_flags=-O2} {additional_flags="-O3"}} # Iterate extra_flags, trying each with C and C++ for {set i 0} {$i < [llength $extra_flags]} {incr i} { -- cgit