summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2011-08-22 10:02:11 +0200
committerStefano Lattarini <stefano.lattarini@gmail.com>2011-08-22 10:02:11 +0200
commit484ec4ec8d7e07e8a63c920b25f3267754542c8e (patch)
treeaa835f784f8a504a2ceef347e44686e250a62566
parent6c20cf0710ef99d0c9b2c1622b18867311cbe78b (diff)
downloadautomake-484ec4ec8d7e07e8a63c920b25f3267754542c8e.tar.gz
tap/awk: support Solaris /usr/xpg4/bin/awk
* lib/tap-driver.sh: Use `\t', not `\\t', to represent tabulation character in regexps, even when inside double-quoted strings; that seems to be more portable to Solaris 10 XPG4 awk.
-rw-r--r--ChangeLog7
-rwxr-xr-xlib/tap-driver.sh26
2 files changed, 20 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index ac143d475..36382fef3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2011-08-22 Stefano Lattarini <stefano.lattarini@gmail.com>
+ tap/awk: support Solaris /usr/xpg4/bin/awk
+ * lib/tap-driver.sh: Use `\t', not `\\t', to represent tabulation
+ character in regexps, even when inside double-quoted strings; that
+ seems to be more portable to Solaris 10 XPG4 awk.
+
+2011-08-22 Stefano Lattarini <stefano.lattarini@gmail.com>
+
tap/awk: support Solaris /usr/bin/nawk
* lib/tap-driver.sh (close_or_die): Remove, the use of the `close'
builtin in there was confusing /usr/bin/nawk from Solaris 10 into
diff --git a/lib/tap-driver.sh b/lib/tap-driver.sh
index 60190b8de..ac87b9eae 100755
--- a/lib/tap-driver.sh
+++ b/lib/tap-driver.sh
@@ -335,8 +335,8 @@ function extract_tap_comment(line)
# FIXME: verify there is not an off-by-one bug here.
line = substr(line, length(diag_string) + 1)
# And strip any leading and trailing whitespace left.
- sub("^[ \\t]*", "", line)
- sub("[ \\t]*$", "", line)
+ sub("^[ \t]*", "", line)
+ sub("[ \t]*$", "", line)
# Return what is left (if any).
return line;
}
@@ -349,7 +349,7 @@ function setup_result_obj(line)
{
# Get the result, and remove it from the line.
result_obj["is_ok"] = (substr(line, 1, 2) == "ok" ? 1 : 0)
- sub("^(not )?ok[ \\t]*", "", line)
+ sub("^(not )?ok[ \t]*", "", line)
# If the result has an explicit number, get it and strip it; otherwise,
# automatically assing the next progresive number to it.
@@ -375,8 +375,8 @@ function setup_result_obj(line)
result_obj["is_unplanned"] = 0
# Strip trailing and leading whitespace.
- sub("^[ \\t]*", "", line)
- sub("[ \\t]*$", "", line)
+ sub("^[ \t]*", "", line)
+ sub("[ \t]*$", "", line)
# This will have to be corrected if we have a "TODO"/"SKIP" directive.
result_obj["description"] = line
@@ -388,7 +388,7 @@ function setup_result_obj(line)
return # No possible directive, nothing more to do.
# Directives are case-insensitive.
- rx = "[ \\t]*#[ \\t]*([tT][oO][dD][oO]|[sS][kK][iI][pP])[ \\t]*"
+ rx = "[ \t]*#[ \t]*([tT][oO][dD][oO]|[sS][kK][iI][pP])[ \t]*"
# See whether we have the directive, and if yes, where.
pos = match(line, rx "$")
@@ -406,13 +406,13 @@ function setup_result_obj(line)
# with already.
line = substr(line, pos)
# Strip the directive, and save its value (normalized to upper case).
- sub("^[ \\t]*#[ \\t]*", "", line)
+ sub("^[ \t]*#[ \t]*", "", line)
result_obj["directive"] = toupper(substr(line, 1, 4))
line = substr(line, 5)
# Now get the explanation for the directive (if any), with leading
# and trailing whitespace removed.
- sub("^[ \\t]*", "", line)
- sub("[ \\t]*$", "", line)
+ sub("^[ \t]*", "", line)
+ sub("[ \t]*$", "", line)
result_obj["explanation"] = line
}
@@ -496,8 +496,8 @@ BEGIN {
# leading and trailing whitespace. This is a little more tricky in
# thruth, since we want to also strip a potential leading "SKIP"
# string from the message.
- sub("^[^#]*#[ \\t]*(SKIP[: \\t][ \\t]*)?", "")
- sub("[ \\t]*$", "");
+ sub("^[^#]*#[ \t]*(SKIP[: \t][ \t]*)?", "")
+ sub("[ \t]*$", "");
handle_tap_plan(0, $0)
next
@@ -509,8 +509,8 @@ BEGIN {
bailed_out = 1
# Get the bailout message (if any), with leading and trailing
# whitespace stripped. The message remains stored in `$0`.
- sub("^Bail out![ \\t]*", "");
- sub("[ \\t]*$", "");
+ sub("^Bail out![ \t]*", "");
+ sub("[ \t]*$", "");
# Format the error message for the
bailout_message = "Bail out!"
if (length($0))