]> git.draconx.ca Git - cdecl99.git/blob - testsuite.at
Fix TEST_NEED_PROGRAM to work on old Solaris /bin/sh.
[cdecl99.git] / testsuite.at
1 AT_COPYRIGHT([Copyright © 2020-2021, 2023 Nick Bowler])
2 #
3 # This program is free software: you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation, either version 3 of the License, or
6 # (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
15
16 m4_include([common/snippet/at-compat.at])
17 m4_include([common/snippet/test-tap.at])
18
19 AT_INIT
20 AT_COLOR_TESTS
21
22 AT_TESTED([cdecl99])
23
24 AT_ARG_OPTION_ARG([random-seed],
25   [AS_HELP_STRING([--random-seed=ARG],
26     [Integer seed for randomized testing (default: auto)])],
27   [random_seed=$at_optarg], [random_seed=$RANDOM$$])
28
29 AT_ARG_OPTION_ARG([random-iterations],
30   [AS_HELP_STRING([--random-iterations=N],
31     [Number of randomized testcases to perform (default: 500)])],
32   [random_iter=$at_optarg], [random_iter=])
33
34 m4_define([RE_LOWER], [abcdefghijklmnopqrstuvwxyz])
35 m4_define([RE_UPPER], m4_toupper(m4_defn([RE_LOWER])))
36 m4_define([RE_ALPHA], m4_defn([RE_UPPER])m4_defn([RE_LOWER]))
37 m4_define([RE_ALNUM], m4_defn([RE_ALPHA])[0-9])
38
39 m4_divert_push([PREPARE_TESTS])dnl
40 : ${LIBTOOL="$SHELL $builddir/libtool"}
41 random_seed=`printf '%s' "$random_seed" | tr -cd '0123456789'`
42 random_seed=${random_seed:-0}
43 random_iter=`printf '%s' "$random_iter" | tr -cd '0123456789'`
44 random_iter=`expr "$random_iter" '|' 500`
45 m4_divert_pop([PREPARE_TESTS])
46
47 m4_define([TEST_NEED_PROGRAM], [AT_KEYWORDS([$1])dnl
48 AT_CHECK([for arg in $check_PROGRAMS; do
49 progexe="$1$EXEEXT"; case $arg in "$progexe"|*/"$progexe") exit 0 ;; esac
50 done
51 exit 77])])
52
53 m4_include([tests/general.at])
54 m4_include([tests/decl-good.at])
55 m4_include([tests/decl-bad.at])
56 m4_include([tests/internal.at])
57 m4_include([tests/stress.at])