tap: improve syncing between awk+shell and perl implementations
authorStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 25 Aug 2011 10:44:32 +0000 (12:44 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 25 Aug 2011 11:56:11 +0000 (13:56 +0200)
commit33d456f2f6387bc2ead8fbe16d67a77edc0336eb
tree6797f09c246b0ef47c5bc84eceef124b51b7717b
parentaba3010e83194e2172006059db08f4fd5992f021
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.
ChangeLog
lib/tap-driver.pl
lib/tap-driver.sh