When we start seeing tapsets provided by third parties, any errors in
their files should not be fatal to us. Since we don't really know which
tapsets are our own, this leniency applies to all.
* main.cxx (main): Warn on tapset errors, but continue unless -W.
* testsuite/parseko/bad_tapset/foo.stp: New bogus tapset.
* testsuite/parseko/bad_tapset.stp: Check that "-W -I bad_tapset" fails.
* testsuite/parseok/bad_tapset.stp: Check that "-I bad_tapset" succeeds.
* testsuite/parseok/all_tapsets.stp: Check -W with the default tapsets.
// 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);
globfree (& globbuf);
}
}
+ if (s.num_errors())
+ rc ++;
if (rc == 0 && s.last_pass == 1)
{
--- /dev/null
+#!/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
--- /dev/null
+# this is an intentional syntax error for testing PR11405
+probe foo = .bar {}
--- /dev/null
+#!/bin/sh
+
+# PR11405: all the default tapsets should succeed even with -W
+
+stap -p1 -e 'probe begin {}' -W
--- /dev/null
+#!/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