1 dnl Copyright © 2015, 2021-2022 Nick Bowler
3 dnl License WTFPL2: Do What The Fuck You Want To Public License, version 2.
4 dnl This is free software: you are free to do what the fuck you want to.
5 dnl There is NO WARRANTY, to the extent permitted by law.
7 m4_divert_push([PREPARE_TESTS])dnl
9 "$builddir/t/$1" > "$1.tap"
15 m4_divert_pop([PREPARE_TESTS])
17 m4_define([TEST_TAP], [AT_CHECK([test_run_tap "$1"], [0], [ignore])])
18 m4_define([TEST_TAP_SIMPLE], [dnl
25 AT_BANNER([Binary packing functions])
27 TEST_TAP_SIMPLE([signed unpacking], [packtests], [], [pack])
28 TEST_TAP_SIMPLE([unsigned unpacking], [packtestu], [], [pack])
29 TEST_TAP_SIMPLE([64-bit signed unpacking], [packtests64], [], [pack])
30 TEST_TAP_SIMPLE([64-bit unsigned unpacking], [packtestu64], [], [pack])
32 AT_BANNER([Help formatting functions])
34 AT_SETUP([help_print_desc])
36 AT_SKIP_IF([test ! -x "$builddir/t/helpdesc"])
39 [[this is the first line
40 this is the second line
41 this is the third line
45 sed -e '5,$s/^/ /' -e '6,$s/^/ /' \
47 -e '13s/^ *//' -e '14,$s/^/ /' \
48 test.txt test.txt test.txt test.txt >expout
50 AT_CHECK(["$builddir/t/helpdesc" 0 0 10 5 30 20 40 40 <test.txt],
55 AT_SETUP([help_print_optstring])
57 AT_SKIP_IF([test ! -x "$builddir/t/helpopt"])
59 AT_CHECK([m4_join([ ],
60 ["$builddir/t/helpopt"],
65 [--quux '@<:@ARG@:>@'],
66 [--quux -q '@<:@ARG@:>@'],
67 [--hello-this-is-a-very-long-option 20],
68 [--hello-this-is-a-very-long-option 50],
70 [--flagged -f \&])], [0],
77 --hello-this-is-a-very-long-option
79 --hello-this-is-a-very-long-option 36
86 AT_SETUP([help_print_optstring (getopt_long_only)])
88 AT_SKIP_IF([test ! -x "$builddir/t/helpopt2"])
90 AT_CHECK([m4_join([ ],
91 ["$builddir/t/helpopt2"],
96 [--quux '@<:@ARG@:>@'],
97 [--quux -q '@<:@ARG@:>@'],
98 [--hello-this-is-a-very-long-option 20],
99 [--hello-this-is-a-very-long-option 50],
101 [--flagged -f \&])], [0],
108 -hello-this-is-a-very-long-option
110 -hello-this-is-a-very-long-option 35