kc3-lang/automake/lib/tap-driver.pl

Branch :


Log

Author Commit Date CI Message
641a5a4b 2012-02-16 10:46:23 maint: run "make update-copyright"
21f97935 2012-02-06 22:45:47 cosmetics: few whitespace fixlets
6b819187 2012-02-02 20:14:30 cosmetics: fix indentation and typos in perl TAP driver * lib/tap-driver.pl (get_test_exit_message): Fix botched indentation. Fix typo in error message: s/ststus/status/.
2077a044 2012-02-02 14:51:59 tap/perl: handle missing or non-executable scripts better This change improves how our Perl-based TAP driver handles non-runnable test scripts (meaning they might be not executable, or not readable, or even not exist). In particular, it makes the driver deterministically display a clear "ERROR" result instead of possibly dying with diagnostic from 'TAP::Parser' internals, and prevents it from displaying spurious "missing TAP plan" errors. Moreover, with this change, some testsuite failures present only with newer perl versions (e.g., 5.14) are fixed. See automake bug#10418. * tests/tap-bad-prog.tap: When testing the perl implementation of the TAP driver, and when the perl interpreter offers a good-enough 'IPC::Open3::open3' function, expect it not to display spurious "missing TAP plan" diagnostic if the error is actually due to a non-runnable test script. * lib/tap-driver.pl (start): Removed, broken up into ... (setup_io): ... this ... (setup_parser): ... and this, which now tries to catch and report errors in launching the test scripts. (finish): New, used by both 'main' and 'setup_parser'. (main): Adjust.
55bada2c 2011-09-07 17:41:40 tap/perl: be more portable to older perl versions * lib/tap-driver.pl (trap_perl_warnings_and_errors): Do not use the three-args version of the `open' builtin, it is not well supported by older perl versions (at least perl 5.6.2). (start): Add a no-op statement to pacify a "possible typo ... used only once" perl warning.
858f4d68 2011-09-07 17:31:23 tap/perl: be more portable to older TAP::Parser versions * lib/tap-driver.pl (start): Do not call the `ignore_exit' method on our TAP parser: it is not supported in older TAP::Parser versions (e.g., 3.10), and is not really required by our usage of the parser object.
33d456f2 2011-08-25 12:44:32 tap: improve syncing between awk+shell and perl implementations * lib/tap-driver.pl (stringify_test_result): Renamed ... (stringify_result_obj): ... to this. Break up a clause in the long "if/elsif/.../else" construct to avoid unaesthetic line breaks and to be more synced with the sibling function in `tap-driver.sh'. Rename the `$result', `$PASS' and `$FAIL' variables to respectively `$result_obj', `$COOKED_PASS' and `$COOKED_FAIL', for clarity and better syncing. (handle_tap_test): Renamed ... (handle_tap_result): ... to this, and change the name of the `$test' local variable to `$result_obj'. (extract_comment): Reimplement using the simpler `index' and `substr' builtins, rather than with more advanced uses of regular expressions. (%test_results, @test_results): Renamed respectively ... (%test_results_seen, @test_results_list): ... to these, and related adjustments throughout the `TEST_RESULTS' block. (main, get_global_test_result): Refactor and do some cosmetic changes to make these functions clearer and better synced with sibling code in `tap-driver.sh'. Other minor cosmetic and typo fixes. * lib/tap-driver.sh (extract_tap_comment): Remove outdated "FIXME" comments. (get_global_test_result): Small reordering to make it better synced with its sibling function in `tap-driver.pl'. (stringify_result_obj): Consistently use `result_obj' as the parameter name. Other minor cosmetic and typo fixes.
aba3010e 2011-08-25 10:53:23 tap/perl: don't redirect perl warnings/errors to log files With this change, the test `tap-driver-stderr.test' also passes with the perl implementation of the TAP driver. * lib/tap-driver.pl (start): Save the original stderr into the `OLDERR' file handle, and call ... (trap_perl_warnings_and_errors): ... this new function, trapping the `__WARN__' and `__DIE__' "pseudo-signals" to ensure that the warning and error messages goes to that original stderr stream. Since we are at it, be sure to prepend all possible "die" message with the name of the script as given by the `$ME' variable.
3cb4cb58 2011-08-25 10:05:51 tap/perl: add copyright notice, version string, and emacs stuff * lib/tap-driver.pl: Add proper copyright notice and bug reporting address. Remove obsolete heading comments. Add trailing comments for emacs w.r.t. code-formatting rules and automatic updating of the date-based script version saved into the `$VERSION' variable. ($VERSION): Define to the current UTC date.
11d8ed52 2011-08-20 13:59:45 cosmetics: fix botched indentation in perl TAP driver * lib/tap-driver.pl (main, Getopt::Long::GetOptions): Fix improper or botched indentation.
1410d5c0 2011-08-17 17:07:59 tap: correctly handle string "0" in TAP messages * lib/tap-driver.pl (is_null_string): New function, can be used to determine whether a given string variable is empty or undefined. Useful to avoid pitfalls like: if ($message) { print "$message\n"; } which wouldn't print anything if $message is the literal "0". (handle_tap_test, handle_tap_plan, handle_tap_bailout): Use it, to avoid missing messages composed only by a literal "0" in TAP result descriptions and in skip, todo and bailout explanations. * tests/tap-message-0.test: Enhance. * tests/Makefile.am (XFAIL_TESTS): Remove it, it passes now.
be241ce3 2011-08-17 16:40:10 tap: a minor simplification in the perl TAP driver * lib/tap-driver.pl: The `--disable-hard-errors' option is a no-op, so just ignore it and its argument.
081e90a8 2011-08-17 16:32:48 parallel-tests: fix help screen for test driver scripts * lib/tap-driver.pl ($USAGE): The `--trs-file' option is mandatory too. * lib/tap-driver.sh (print_usage): Likewise. * lib/test-driver (print_usage): Likewise. ($scriptversion): Update.
51f413e9 2011-08-17 14:59:19 tap: add a dummy TAP driver script implemented in shell + awk The user can also now decide which implementation of the TAP driver to use in the testsuite by defining the `$am_tap_implementation' variable to either "perl" or "shell". Future enhancements will allow the testsuite to automatically run the test scripts on TAP support with both the TAP driver implementations, to improve coverage. * tests/defs (fetch_tap_driver): Honor the `$am_tap_implementation' variable to decide which implementation of the TAP driver to fetch. ($am_tap_implementation): Default to "perl". * tests/tap-common-setup.test: Do not fetch the TAP driver, the code in tap-setup.sh does that already (and respecting runtime overriding of `$am_tap_implementation'). * lib/tap-driver: Renamed ... * lib/tap-driver.pl: ... to this, and ... ($ME): ... adjusted this. * doc/automake.texi: Adjust to the renaming. * tests/Makefile.am (TAP_LOG_DRIVER): Likewise. * tests/tap-doc2.test: Likewise. * lib/tap-driver.sh: New script, still mostly dummy. * lib/Makefile.am (dist_script_DATA): Update, and since we are at it, rewrite it to make it easier to add new entries in the future.