Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Add support for interpreter files
A D script foo.d can be run with "dtrace -s foo.d". Alternatively, it can be made an executable interpreter file by adding a "#!dtrace -s" initial line (using the correct path to dtrace) and then "chmod +x foo.d". At that point, it can be run "./foo.d". A few tests have the #! initial line and therefore seem to intend to use the second, interpreter invocation style. In particular, this is how some scripting tests are implemented. But if a test has a .d extension, runtest.sh invokes it using "dtrace -s foo.d". This means we ignore the initial #! line: both the specific path to dtrace as well as any dtrace options that are specified on the initial #! line. There are some *.sh tests that get around this problem by setting up their own .d files and invoking them, but this means that some minor infrastructure is being replicated from file to file. Add support in runtest.sh for *.d executable interpreter files. In such a file, the initial #! line should start #!dtrace, since runtest.sh will replace the "dtrace" with the absolute path to the dtrace being tested. Signed-off-by: Eugene Loh <eugene.loh@oracle.com> Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
- Loading branch information