summaryrefslogtreecommitdiff
path: root/tests/test_driver.pl
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2007-11-04 21:54:00 +0000
committerPaul Smith <psmith@gnu.org>2007-11-04 21:54:00 +0000
commit3870944eb57702d6de534183d9ff77f94fcf0c5d (patch)
treeabaa4fc983ce53dc44d006bb66d76a9e99505329 /tests/test_driver.pl
parent70e8a8dd37d6acc81a64869f872c1f8185a73506 (diff)
downloadmake-3870944eb57702d6de534183d9ff77f94fcf0c5d.tar.gz
New special variable: .RECIPEPREFIX
Allows the user to reset the prefix character for introducing recipe lines from the default (tab) to any other single character, and back again. Also, reworked the manual to consistently use the word "recipe" to describe the set of commands we use to update a target, instead of the various phrases used in the past: "commands", "command lines", "command scripts", etc.
Diffstat (limited to 'tests/test_driver.pl')
-rw-r--r--tests/test_driver.pl16
1 files changed, 12 insertions, 4 deletions
diff --git a/tests/test_driver.pl b/tests/test_driver.pl
index bea98162..dd303206 100644
--- a/tests/test_driver.pl
+++ b/tests/test_driver.pl
@@ -661,15 +661,23 @@ sub compare_output
$answer_matched = 1;
} else {
# See if it is a slash or CRLF problem
- local ($answer_mod) = $answer;
+ local ($answer_mod, $slurp_mod) = ($answer, $slurp);
$answer_mod =~ tr,\\,/,;
$answer_mod =~ s,\r\n,\n,gs;
- $slurp =~ tr,\\,/,;
- $slurp =~ s,\r\n,\n,gs;
+ $slurp_mod =~ tr,\\,/,;
+ $slurp_mod =~ s,\r\n,\n,gs;
- $answer_matched = ($slurp eq $answer_mod);
+ $answer_matched = ($slurp_mod eq $answer_mod);
+
+ # If it still doesn't match, see if the answer might be a regex.
+ if (!$answer_matched && $answer =~ m,^/(.+)/$,) {
+ $answer_matched = ($slurp =~ /$1/);
+ if (!$answer_matched && $answer_mod =~ m,^/(.+)/$,) {
+ $answer_matched = ($slurp_mod =~ /$1/);
+ }
+ }
}
if ($answer_matched && $test_passed)