]> git.draconx.ca Git - cdecl99.git/blobdiff - testsuite.at
Port randomdecl sanity test to Autotest.
[cdecl99.git] / testsuite.at
index dc1678319484636689074175b3b7146ebd9eccb3..930ff2ceaf4102d11b72d3deaf36b4a63cdbf0a8 100644 (file)
@@ -18,10 +18,24 @@ AT_COLOR_TESTS
 
 AT_TESTED([cdecl99])
 
+AT_ARG_OPTION_ARG([random-seed],
+  [AS_HELP_STRING([--random-seed=ARG],
+    [Integer seed for randomized testing (default: auto)])],
+  [random_seed=$at_optarg], [random_seed=$RANDOM$$])
+
 m4_divert_push([PREPARE_TESTS])dnl
 : ${LIBTOOL="$SHELL $builddir/libtool"}
+random_seed=`printf '%s' "$random_seed" | tr -cd '@<:@:digit:@:>@'`
+random_seed=${random_seed:-0}
 m4_divert_pop([PREPARE_TESTS])
 
+m4_define([TEST_NEED_PROGRAM], [AT_KEYWORDS([$1])dnl
+AT_CHECK([for arg in $check_PROGRAMS; do
+test x"${arg##*/}" != x"$1$EXEEXT" || exit 0
+done
+exit 77])])
+
 m4_include([tests/general.at])
 m4_include([tests/decl-good.at])
 m4_include([tests/decl-bad.at])
+m4_include([tests/stress.at])