test-tap.at: Fix regression passing program arguments.
[dxcommon.git] / t / gob2.sh
blob0e167943b87c4c252d13f99512952c2d74d5b592
1 #!/bin/sh
3 # Copyright © 2020 Nick Bowler
5 # Fake gob2 program for testing the gob2 detection macro.
7 # License WTFPL2: Do What The Fuck You Want To Public License, version 2.
8 # This is free software: you are free to do what the fuck you want to.
9 # There is NO WARRANTY, to the extent permitted by law.
11 : "${FAKE_GOB2_VERSION=2.0.0}"
13 argv0=$0
15 infile=
16 for arg
18 case $arg in
19 *.gob)
20 infile=$arg
21 esac
22 done
24 if test x"$infile" = x""; then
25 printf '%s: error: no input file\n' "$argv0" 1>&2
26 exit 1
29 exec 3<"$infile"
30 save_IFS=$IFS
31 while IFS=$IFS. read a b c d e <&3; do
32 case $a in
33 requires)
34 IFS=$IFS.
35 set x $FAKE_GOB2_VERSION; shift
36 IFS=$save_IFS
38 { test "${1:-0}" -gt "${b:-0}" ||
39 { test "${1:-0}" -eq "${b:-0}" &&
40 { test "${2:-0}" -gt "${c:-0}" ||
41 { test "${2:-0}" -eq "${c:-0}" && test "${3:-0}" -ge "${d:-}"
42 }; }; }; } ||
43 { printf '%s: error: minimum version not met\n' "$argv0"; exit; }
45 esac
46 done
48 cat >conftest.c <<'EOF'
49 int conftest_get_type(void) { }
50 EOF