]> git.draconx.ca Git - gob-dx.git/commitdiff
Fix awk usage in the testsuite.
authorNick Bowler <nbowler@draconx.ca>
Fri, 25 Feb 2022 01:18:16 +0000 (20:18 -0500)
committerNick Bowler <nbowler@draconx.ca>
Fri, 25 Feb 2022 04:09:32 +0000 (23:09 -0500)
We should be using the configure-detected $AWK in the testsuite to
ensure reasonable behaviour.  And remove the use of the GNU-specific
-N option, which appears to just be a mistake.

Makefile.am
tests/general.at
tests/options.at

index 3932dcb3849f34efb7be11ff3698a4c29ca37b76..8c084bc30b897ce6c9bfe30e754e52c0f1e2b8ad 100644 (file)
@@ -209,6 +209,7 @@ atlocal: config.status
          printf ': "$${%s=%s}"\n' \
            CC '$(CC)' \
            CXX '$(CXX)' \
+           AWK '$(AWK)' \
            CPPFLAGS '$(CPPFLAGS)' \
            CFLAGS '$(CFLAGS)' \
            CXXFLAGS '$(CXXFLAGS)' \
index 624af5a9a8199e09e0a98a32bae22c55dfacde47..e35c578a8032d81193de819bd82ce7efc9ad1b3b 100644 (file)
@@ -1,4 +1,4 @@
-dnl Copyright © 2019-2021 Nick Bowler
+dnl Copyright © 2019-2022 Nick Bowler
 dnl License GPLv2+: GNU General Public License version 2 or any later version.
 dnl This is free software: you are free to change and redistribute it.
 dnl There is NO WARRANTY, to the extent permitted by law.
@@ -51,19 +51,19 @@ TEST_COMPILE_GOBJECT([str.c], [0], [], [stderr])
 mv stderr str_stderr
 
 # Check for correct diagnostic messages on the target lines...
-AT_CHECK([awk '/want a string/ { print NR }' "$str_gob" >str_lines])
+AT_CHECK([$AWK '/want a string/ { print NR }' "$str_gob" >str_lines])
 total=0
 exec 3<str_lines
 while read l <&3; do
   AS_VAR_ARITH([total], [1 + $total])
-  AT_CHECK([awk -v line="$l" -v file="$str_gob" -NF : \
+  AT_CHECK([$AWK -v line="$l" -v file="$str_gob" -F : \
     '$1 == file && $2 == line { exit 42 }' str_stderr], [42])
 done
 exec 3<&-
 AT_CHECK([test x"$total" = x"2"])
 
 TEST_COMPILE_GOBJECT([main.c], [0], [], [stderr])
-AT_CHECK([awk -NF : '$1 == "main.c" && $2 == "16" { exit 42 }' stderr], [42])
+AT_CHECK([$AWK -F : '$1 == "main.c" && $2 == "16" { exit 42 }' stderr], [42])
 
 AT_CHECK([$CC $CFLAGS $LDFLAGS $LIBGOBJECT_LIBS -o main str.o main.o])
 
index f8d56e4bed4c889ab06d8f26ffee74c6af4d36d0..089a87e55175fe082fbca9a80035f8be42a68e57 100644 (file)
@@ -1,4 +1,4 @@
-dnl Copyright © 2020-2021 Nick Bowler
+dnl Copyright © 2020-2022 Nick Bowler
 dnl License GPLv2+: GNU General Public License version 2 or any later version.
 dnl This is free software: you are free to change and redistribute it.
 dnl There is NO WARRANTY, to the extent permitted by law.
@@ -18,7 +18,7 @@ AT_SETUP([--version option])
 AT_KEYWORDS([option])dnl
 
 AT_CHECK([gob2 invalid-file.gob --version --invalid-option], [0], [stdout])
-AT_CHECK([awk 'NR == 1 { print $NF }' stdout], [0], [AT_PACKAGE_VERSION
+AT_CHECK([$AWK 'NR == 1 { print $NF }' stdout], [0], [AT_PACKAGE_VERSION
 ])
 
 AT_CLEANUP