summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main.cxx5
-rwxr-xr-xtestsuite/parseko/bad_tapset.stp6
-rw-r--r--testsuite/parseko/bad_tapset/foo.stp2
-rwxr-xr-xtestsuite/parseok/all_tapsets.stp5
-rwxr-xr-xtestsuite/parseok/bad_tapset.stp6
5 files changed, 23 insertions, 1 deletions
diff --git a/main.cxx b/main.cxx
index dd2694ae..5f746efd 100644
--- a/main.cxx
+++ b/main.cxx
@@ -1261,7 +1261,8 @@ main (int argc, char * const argv [])
// XXX: privilege only for /usr/share/systemtap?
stapfile* f = parser::parse (s, globbuf.gl_pathv[j], true);
if (f == 0)
- rc ++;
+ s.print_warning("tapset '" + string(globbuf.gl_pathv[j])
+ + "' has errors, and will be skipped.");
else
s.library_files.push_back (f);
@@ -1281,6 +1282,8 @@ main (int argc, char * const argv [])
globfree (& globbuf);
}
}
+ if (s.num_errors())
+ rc ++;
if (rc == 0 && s.last_pass == 1)
{
diff --git a/testsuite/parseko/bad_tapset.stp b/testsuite/parseko/bad_tapset.stp
new file mode 100755
index 00000000..bd15577f
--- /dev/null
+++ b/testsuite/parseko/bad_tapset.stp
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# PR11405: with -W, bad tapsets should still be an error
+
+TAPSET=`dirname $0`/bad_tapset/
+stap -p1 -e 'probe begin {}' -I $TAPSET -W
diff --git a/testsuite/parseko/bad_tapset/foo.stp b/testsuite/parseko/bad_tapset/foo.stp
new file mode 100644
index 00000000..c4c77257
--- /dev/null
+++ b/testsuite/parseko/bad_tapset/foo.stp
@@ -0,0 +1,2 @@
+# this is an intentional syntax error for testing PR11405
+probe foo = .bar {}
diff --git a/testsuite/parseok/all_tapsets.stp b/testsuite/parseok/all_tapsets.stp
new file mode 100755
index 00000000..1777cc10
--- /dev/null
+++ b/testsuite/parseok/all_tapsets.stp
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+# PR11405: all the default tapsets should succeed even with -W
+
+stap -p1 -e 'probe begin {}' -W
diff --git a/testsuite/parseok/bad_tapset.stp b/testsuite/parseok/bad_tapset.stp
new file mode 100755
index 00000000..a97c037f
--- /dev/null
+++ b/testsuite/parseok/bad_tapset.stp
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# PR11405: without -W, bad tapsets will be warned but shouldn't be an error
+
+TAPSET=`dirname $0`/../parseko/bad_tapset/
+stap -p1 -e 'probe begin {}' -I $TAPSET