]> git.draconx.ca Git - cdecl99.git/blob - testsuite.at
Release 1.3.
[cdecl99.git] / testsuite.at
1 AT_COPYRIGHT([Copyright (C) 2020-2021, 2023-2024 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 m4_divert_push([PREPARE_TESTS])dnl
23 {
24   echo "% cdecl99 --version"
25   cdecl99 --version </dev/null
26   echo
27 } >&AS_MESSAGE_LOG_FD 2>&1
28 m4_divert_pop([PREPARE_TESTS])
29
30 AT_ARG_OPTION_ARG([random-seed],
31   [AS_HELP_STRING([--random-seed=ARG],
32     [Integer seed for randomized testing (default: auto)])],
33   [random_seed=$at_optarg],
34   [random_seed=`echo $RANDOM$$ | sed 's/\(........\).*/\1/'`])#'
35
36 AT_ARG_OPTION_ARG([random-iterations],
37   [AS_HELP_STRING([--random-iterations=N],
38     [Number of randomized testcases to perform (default: 500)])],
39   [random_iter=$at_optarg], [random_iter=])
40
41 m4_define([RE_LOWER], [abcdefghijklmnopqrstuvwxyz])
42 m4_define([RE_UPPER], m4_toupper(m4_defn([RE_LOWER])))
43 m4_define([RE_ALPHA], m4_defn([RE_UPPER])m4_defn([RE_LOWER]))
44 m4_define([RE_ALNUM], m4_defn([RE_ALPHA])[0-9])
45
46 m4_divert_push([PREPARE_TESTS])dnl
47 : ${LIBTOOL="$SHELL $builddir/libtool"}
48 random_seed=`printf '%s' "$random_seed" | tr -cd '0123456789'`
49 random_seed=${random_seed:-0}
50 random_iter=`printf '%s' "$random_iter" | tr -cd '0123456789'`
51 random_iter=`expr "$random_iter" '|' 500`
52 m4_divert_pop([PREPARE_TESTS])
53
54 m4_define([TEST_NEED_PROGRAM], [AT_KEYWORDS([$1])dnl
55 AT_CHECK([for arg in $check_PROGRAMS; do
56 progexe="$1$EXEEXT"; case $arg in "$progexe"|*/"$progexe") exit 0 ;; esac
57 done
58 exit 77])])
59
60 m4_include([tests/general.at])
61 m4_include([tests/decl-good.at])
62 m4_include([tests/decl-bad.at])
63 m4_include([tests/internal.at])
64 m4_include([tests/stress.at])