]> sourceware.org Git - systemtap.git/commitdiff
PR17962: make dtrace.exp "parser check" test case conditional on pyparsing
authorFrank Ch. Eigler <fche@redhat.com>
Wed, 18 Feb 2015 17:24:52 +0000 (12:24 -0500)
committerFrank Ch. Eigler <fche@redhat.com>
Wed, 18 Feb 2015 17:24:52 +0000 (12:24 -0500)
Without pyparsing installed, the test gave a false FAIL: indication.

testsuite/systemtap.base/dtrace.exp

index 57e31f2ec81a4ff881498939a2958aa28d9340a8..0928f8c0c3bcf45ccd3b51e0e552fb9c5e5ffd95 100644 (file)
@@ -241,25 +241,28 @@ exec rm -f XXX.h
 # -----------------------------------------------------------------
 # test fallback to --no-pyparsing
 
-set ok 0
-verbose -log "$dtrace -C -h -s $pypath -o XXX.h"
-spawn $dtrace -C -DDCL_AFTER_PROVIDER -h -s $pypath -o XXX.h
-expect {
-    -re {Warning.*syntax error} {incr ok; exp_continue}
-    -re {Warning.*--no-pyparsing} {incr ok; exp_continue}
-    eof { }
-}
-catch {close}; catch {wait}
-if {[file exists XXX.h]} then {
-    incr ok;
-}
-if { $ok == 3} {
-    pass "dtrace parser check"
+if {[catch {exec python -c "import pyparsing"} res]} then {
+    untested "dtrace parser check"
 } else {
-    fail "dtrace parser check $ok"
+    set ok 0
+    verbose -log "$dtrace -C -h -s $pypath -o XXX.h"
+    spawn $dtrace -C -DDCL_AFTER_PROVIDER -h -s $pypath -o XXX.h
+    expect {
+        -re {Warning.*syntax error} {incr ok; exp_continue}
+        -re {Warning.*--no-pyparsing} {incr ok; exp_continue}
+        eof { }
+    }
+    catch {close}; catch {wait}
+    if {[file exists XXX.h]} then {
+        incr ok;
+    }
+    if { $ok == 3} {
+        pass "dtrace parser check"
+    } else {
+        fail "dtrace parser check $ok"
+    }
+    exec rm -f XXX.h
 }
-exec rm -f XXX.h
-
 # -----------------------------------------------------------------
 # test -G object file creation
 
This page took 0.029534 seconds and 5 git commands to generate.