]> git.draconx.ca Git - dxcommon.git/blob - tests/functions.at
Import integer packing library.
[dxcommon.git] / tests / functions.at
1 dnl Copyright © 2015 Nick Bowler
2 dnl
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.
6
7 m4_divert_push([PREPARE_TESTS])dnl
8 test_run_tap () {
9   "$builddir/t/$1" > "$1.tap"
10   status=$?
11   cat "$1.tap"
12   prove -e cat "$1.tap"
13   return $status
14 }
15 m4_divert_pop([PREPARE_TESTS])
16
17 m4_define([TEST_TAP], [AT_CHECK([test_run_tap "$1"], [0], [ignore])])
18 m4_define([TEST_TAP_SIMPLE], [dnl
19 AT_SETUP([$1])
20 AT_KEYWORDS([$4])dnl
21 m4_n([$3])dnl
22 TEST_TAP([$2])
23 AT_CLEANUP])
24
25 AT_BANNER([Binary packing functions])
26
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])