]> git.draconx.ca Git - gob-dx.git/blobdiff - tests/options.at
Avoid "touch" in the testsuite.
[gob-dx.git] / tests / options.at
index 2f850198f54c427d695de3dbb66b0bf5e5d9c452..820416a438e7353100c47fe74173685796950afd 100644 (file)
@@ -1,4 +1,4 @@
-dnl Copyright © 2020 Nick Bowler
+dnl Copyright © 2020-2023 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.
@@ -8,8 +8,6 @@ dnl standard output.
 AT_SETUP([--help option])
 AT_KEYWORDS([option])dnl
 
-# Currently prints to standard error :(
-AT_XFAIL_IF([:])
 AT_CHECK([gob2 invalid-file.gob --help --invalid-option], [0], [ignore-nolog])
 
 AT_CLEANUP
@@ -19,10 +17,8 @@ dnl standard output, and contains the correct version number.
 AT_SETUP([--version option])
 AT_KEYWORDS([option])dnl
 
-# Currently prints to standard error :(
-AT_XFAIL_IF([:])
 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
@@ -290,9 +286,9 @@ m4_foreach([OPTION], [[[--no-touch]], [[--no-touch-headers]]],
 AT_KEYWORDS([option])dnl
 
 # Sanity check for make implementation
-touch test.h; touch test-h
+echo >>test.h; echo >>test-h
 AT_CHECK([mtime_uptodate test-h test.h || exit 77])
-TEST_MTIME_DELAY; touch test.h
+TEST_MTIME_DELAY; echo >>test.h
 AT_CHECK([mtime_uptodate test-h test.h && exit 77], [1])
 rm -f test.h
 
@@ -302,19 +298,15 @@ AT_DATA([test.gob], [[class :Test from G:Object
 }
 ]])
 
-m4_if(OPTION, [--no-touch-headers],
-[#Currently, the private header is modified even with --no-touch-headers.
-AT_XFAIL_IF([:])])dnl
-
 AT_CHECK([gob2 test.gob])
-touch test-c test-h test-private
+echo >>test-c; echo >>test-h; echo >>test-private
 TEST_MTIME_DELAY
 AT_CHECK([gob2 test.gob])
 AT_CHECK([mtime_uptodate test-c test.c], [1])
 AT_CHECK([mtime_uptodate test-h test.h], [1])
 AT_CHECK([mtime_uptodate test-private test-private.h], [1])
 
-touch test-c test-h test-private
+echo >>test-c; echo >>test-h; echo >>test-private
 TEST_MTIME_DELAY
 AT_CHECK([gob2 test.gob OPTION])
 AT_CHECK([mtime_uptodate test-c test.c],
@@ -327,7 +319,7 @@ cat >>test.gob <<'EOF'
 /* some code */
 %}
 EOF
-touch test-c test-h test-private
+echo >>test-c; echo >>test-h; echo >>test-private
 TEST_MTIME_DELAY
 AT_CHECK([gob2 test.gob OPTION])
 AT_CHECK([mtime_uptodate test-c test.c], [1])
@@ -339,7 +331,7 @@ cat >>test.gob <<'EOF'
 /* yonder comment */
 %}
 EOF
-touch test-c test-h test-private
+echo >>test-c; echo >>test-h; echo >>test-private
 TEST_MTIME_DELAY
 AT_CHECK([gob2 test.gob OPTION])
 AT_CHECK([mtime_uptodate test-c test.c],
@@ -352,7 +344,7 @@ cat >>test.gob <<'EOF'
 /* once more unto the breach */
 %}
 EOF
-touch test-c test-h test-private
+echo >>test-c; echo >>test-h; echo >>test-private
 TEST_MTIME_DELAY
 AT_CHECK([gob2 test.gob OPTION])
 AT_CHECK([mtime_uptodate test-c test.c],
@@ -426,9 +418,6 @@ class :Test from G:Object
 }
 ]])
 
-# --no-gnu is currently busted for the get_type function declaration.
-AT_XFAIL_IF([:])
-
 AT_CHECK([gob2 test.gob])
 AT_CHECK([cat test*.h test.c | grep '_GNUC_' >/dev/null], [0])
 
@@ -580,6 +569,18 @@ AT_CHECK([gob2 --m4 filename --help I am trapped in a test case factory --],
   [0], [], [experr])
 AT_CHECK([test -f m4-test.c])
 
+set x $gob_m4_args; shift
+for arg
+do
+  shift
+  AS_CASE([$arg], [filename], [], [*], [set x "$@" "$arg"; shift])
+done
+
+cat >experr <<EOF
+$* -- filename
+EOF
+AT_CHECK([gob2 --m4 -- filename], [0], [], [experr])
+
 AT_CLEANUP
 
 dnl Check that the --m4 option shells out to m4 and passes through