]> git.draconx.ca Git - gob-dx.git/blobdiff - tests/options.at
Convert command-line options processing to getopt_long.
[gob-dx.git] / tests / options.at
index 22e96091b01cc048f5e9b9f3e0c0ca056a84438b..f8d56e4bed4c889ab06d8f26ffee74c6af4d36d0 100644 (file)
@@ -1,4 +1,4 @@
-dnl Copyright © 2020 Nick Bowler
+dnl Copyright © 2020-2021 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.
@@ -17,8 +17,6 @@ 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
 ])
@@ -300,10 +298,6 @@ 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
 TEST_MTIME_DELAY
@@ -424,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])
 
@@ -578,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