docs
[pspp] / tests / testsuite.in
1 dnl PSPP - a program for statistical analysis.   -*- autotest -*-
2 dnl Copyright (C) 2017 Free Software Foundation, Inc.
3 dnl
4 dnl This program is free software: you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation, either version 3 of the License, or
7 dnl (at your option) any later version.
8 dnl
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 dnl GNU General Public License for more details.
13 dnl
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 dnl
17
18 AT_INIT
19
20 m4_ifdef([AT_COLOR_TESTS], [AT_COLOR_TESTS])
21
22 # Define SKIP_IF for compatibility with Autotest before 2.64
23 m4_ifndef([AT_SKIP_IF],
24   [m4_define([AT_SKIP_IF],
25      [AT_CHECK([($1) \
26 && exit 77 || exit 0], [0], [ignore], [ignore])])])
27
28 m4_divert_text([PREPARE_TESTS], [dnl
29 if test X"$RUNNER" != X; then
30     wrapper_dir=`pwd`/wrappers
31     rm -f "$wrapper_dir"/*
32     test -d "$wrapper_dir" || mkdir "$wrapper_dir"
33
34     wrap_dir () {
35         test -d "$1" || return
36         for file in "$1"/*; do
37             if test -x "$file" && test -f "$file"; then
38                 base=`basename $file $EXEEXT`
39                 wrapper=$wrapper_dir/$base
40                 if test ! -e "$wrapper"; then
41                     echo "exec $RUNNER $file \"\$@\"" > $wrapper
42                     chmod +x $wrapper
43                 fi
44             fi
45         done
46     }
47
48     save_IFS=$IFS; IFS=$PATH_SEPARATOR
49     for dir in $AUTOTEST_PATH; do
50         IFS=$save_IFS
51         test X"$dir" = X && dir=.
52         case $dir in
53             [\\/]* | ?:[\\/]*)
54                 wrap_dir "$dir"
55                 ;;
56             *)
57                 wrap_dir "$abs_top_builddir/$dir"
58                 wrap_dir "$abs_top_srcdir/$dir"
59                 ;;
60         esac
61     done
62     IFS=$save_IFS
63     PATH=$wrapper_dir:$PATH
64 fi
65 ])