]> git.draconx.ca Git - gob-dx.git/blobdiff - tests/general.at
Fix awk usage in the testsuite.
[gob-dx.git] / tests / general.at
index a36e4df17a9c8e571d580fa486a4981ecdc3016e..e35c578a8032d81193de819bd82ce7efc9ad1b3b 100644 (file)
@@ -1,4 +1,4 @@
-dnl Copyright © 2019-2020 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.
@@ -46,23 +46,24 @@ int main(void)
 
 str_gob=$abs_top_srcdir/t/str.gob
 AT_CHECK([gob2 "$str_gob"])
+AT_CHECK([$HAVE_GOBJECT_PRIVATES || exit 77])
 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])
 
@@ -189,6 +190,7 @@ AT_DATA([test.in], [[@GOB2@
 cat >configure.ac <<EOF
 [m4@&t@_include([$builddir/gob2.m4])]
 [m4@&t@_pattern_forbid([^GOB2_])]
+[m4@&t@_pattern_forbid([^DX_])]
 [AC_INIT([gob2_check], [0])]
 [GOB2_CHECK(]m4_dquote(m4_defn([MYVER]))[)]
 GOB2=\`command -v \$GOB2\`
@@ -223,6 +225,7 @@ class :Test from G:Object
 }
 ]])
 AT_CHECK([gob2 test.gob])
+AT_CHECK([$HAVE_GOBJECT_PRIVATES || exit 77])
 TEST_COMPILE_GOBJECT([test.c], [0], [], [ignore])
 
 AT_DATA([main.c], [[#include <config.h>
@@ -263,6 +266,7 @@ class :Test from G:Object (dynamic)
 }
 ]])
 AT_CHECK([gob2 test.gob])
+AT_CHECK([$HAVE_GOBJECT_PRIVATES || exit 77])
 TEST_COMPILE_GOBJECT([test.c], [0], [], [ignore])
 
 TEST_TYPE_MODULE([:Test])