ea502079b068fcd5d93d8c0747aa436da288460a
[pspp] / tests / testsuite.in
1 dnl PSPP - a program for statistical analysis.
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 # Define SKIP_IF for compatibility with Autotest before 2.64
21 m4_ifndef([AT_SKIP_IF],
22   [m4_define([AT_SKIP_IF],
23      [AT_CHECK([($1) \
24 && exit 77 || exit 0], [0], [ignore], [ignore])])])
25
26 m4_divert_text([PREPARE_TESTS], [dnl
27 if test X"$RUNNER" != X; then
28     wrapper_dir=`pwd`/wrappers
29     rm -f "$wrapper_dir"/*
30     test -d "$wrapper_dir" || mkdir "$wrapper_dir"
31
32     wrap_dir () {
33         test -d "$1" || return
34         for file in "$1"/*; do
35             if test -x "$file" && test -f "$file"; then
36                 base=`basename $file $EXEEXT`
37                 wrapper=$wrapper_dir/$base
38                 if test ! -e "$wrapper"; then
39                     echo "exec $RUNNER $file \"\$@\"" > $wrapper
40                     chmod +x $wrapper
41                 fi
42             fi
43         done
44     }
45
46     save_IFS=$IFS; IFS=$PATH_SEPARATOR
47     for dir in $AUTOTEST_PATH; do
48         IFS=$save_IFS
49         test X"$dir" = X && dir=.
50         case $dir in
51             [\\/]* | ?:[\\/]*)
52                 wrap_dir "$dir"
53                 ;;
54             *)
55                 wrap_dir "$abs_top_builddir/$dir"
56                 wrap_dir "$abs_top_srcdir/$dir"
57                 ;;
58         esac
59     done
60     IFS=$save_IFS
61     PATH=$wrapper_dir:$PATH
62 fi
63 ])