One potential use is to run tests under an emulator such as wine.
HOME=/nonexistent # Kluge to make PSPP ignore $HOME/.pspprc.
export HOME
-PSPP=$abs_top_builddir/src/ui/terminal/pspp$EXEEXT
-export PSPP
-
-PSPPCONVERT=$abs_top_builddir/utilities/pspp-convert$EXEEXT
-export PSPPCONVERT
-
-
# Avoids error messages during tests if $TERM is set to an unknown terminal.
TERM=; unset TERM
-if test X"$RUNNER" != X; then
- pspp () {
- $RUNNER $PSPP "$@"
- }
-fi
-
pspp_diff=`which diff`
if test X"$RUNNER" = Xwine; then
diff () {
AUTOTEST_PATH = tests/data:tests/language/lexer:tests/libpspp:tests/output:src/ui/terminal:utilities
$(srcdir)/tests/testsuite.at: tests/testsuite.in tests/automake.mk
- $(AM_V_GEN)cp $< $@
+ $(AM_V_GEN)printf '\043 Generated automatically -- do not modify! -*- buffer-read-only: t -*-\n' > $@,tmp
+ $(AM_V_at)cat $< >> $@,tmp
$(AM_V_at)for t in $(TESTSUITE_AT); do \
- echo "m4_include([$$t])" >> $@ ;\
+ echo "m4_include([$$t])" >> $@,tmp ;\
done
+ mv $@,tmp $@
+
EXTRA_DIST += tests/testsuite.at
CHECK_LOCAL += tests_check
tests_check: tests/atconfig tests/atlocal $(TESTSUITE) $(check_PROGRAMS)
- XTERM_LOCALE='' $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) $(TESTSUITEFLAGS)
+ XTERM_LOCALE='' $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) RUNNER='$(RUNNER)' $(TESTSUITEFLAGS)
CLEAN_LOCAL += tests_clean
tests_clean:
echo 'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])' && \
echo 'm4_define([AT_PACKAGE_URL], [$(PACKAGE_URL)])'; \
} >'$(srcdir)/package.m4'
-\f
-# valgrind support for Autotest testsuite
-
-valgrind_wrappers = \
- tests/valgrind/datasheet-test \
- tests/valgrind/command-name-test \
- tests/valgrind/scan-test \
- tests/valgrind/segment-test \
- tests/valgrind/abt-test \
- tests/valgrind/bt-test \
- tests/valgrind/encoding-guesser-test \
- tests/valgrind/heap-test \
- tests/valgrind/hmap-test \
- tests/valgrind/hmapx-test \
- tests/valgrind/i18n-test \
- tests/valgrind/ll-test \
- tests/valgrind/llx-test \
- tests/valgrind/range-map-test \
- tests/valgrind/range-set-test \
- tests/valgrind/range-tower-test \
- tests/valgrind/sparse-array-test \
- tests/valgrind/sparse-xarray-test \
- tests/valgrind/str-test \
- tests/valgrind/string-map-test \
- tests/valgrind/stringi-map-test \
- tests/valgrind/string-set-test \
- tests/valgrind/stringi-set-test \
- tests/valgrind/tower-test \
- tests/valgrind/u8-istream-test \
- tests/valgrind/render-test \
- tests/valgrind/pspp-convert \
- tests/valgrind/pspp
-
-$(valgrind_wrappers): tests/valgrind-wrapper.in
- @$(MKDIR_P) tests/valgrind
- $(AM_V_GEN)$(SED) -e 's,[@]wrap_program[@],$@,' \
- $(top_srcdir)/tests/valgrind-wrapper.in > $@.tmp
- $(AM_V_at)chmod +x $@.tmp
- $(AM_V_at)mv $@.tmp $@
-CLEANFILES += $(valgrind_wrappers)
-EXTRA_DIST += tests/valgrind-wrapper.in
-VALGRIND = $(SHELL) $(abs_top_builddir)/libtool --mode=execute valgrind --log-file=valgrind.%p --leak-check=full --num-callers=20
-check-valgrind: all tests/atconfig tests/atlocal $(TESTSUITE) $(valgrind_wrappers)
- XTERM_LOCALE='' $(SHELL) '$(TESTSUITE)' -C tests VALGRIND='$(VALGRIND)' AUTOTEST_PATH='tests/valgrind:$(AUTOTEST_PATH)' -d $(TESTSUITEFLAGS)
+check-valgrind:
+ $(MAKE) check RUNNER='$(SHELL) $(abs_top_builddir)/libtool --mode=execute valgrind --log-file=valgrind.%p --leak-check=full --num-callers=20' TESTSUITEFLAGS='$(TESTSUITEFLAGS) -d'
@echo
@echo '--------------------------------'
@echo 'Valgrind output is in:'
]])
AT_CHECK([$PERL num-out.pl > num-out.sps])
AT_CHECK([pspp -O format=csv num-out.sps])
-AT_CHECK([inexactify$EXEEXT < output.txt > output.inexact])
+AT_CHECK([inexactify < output.txt > output.inexact])
AT_CHECK([gzip -cd < $top_srcdir/tests/data/num-out.expected.cmp.gz > expout.cmp])
AT_DATA([num-out-decmp.pl],
[[use strict;
[AT_SETUP([$1x$2, $3 backing rows, backing widths $4])
AT_KEYWORDS([datasheet])
AT_CHECK(
- [datasheet-test$EXEEXT --verbosity=0 --max-rows=$1 --max-columns=$2 \
+ [datasheet-test --verbosity=0 --max-rows=$1 --max-columns=$2 \
--backing-rows=$3 --backing-widths=$4],
[0], [ignore], [ignore])
AT_CLEANUP])
AT_SETUP([in-memory sparse_xarray])
dnl --values=3 would be a slightly better test but takes much longer.
-AT_CHECK([sparse-xarray-test$EXEEXT \
+AT_CHECK([sparse-xarray-test \
--verbosity=0 --queue-limit=`sparse_xarray_queue_limit` \
--columns=3 --max-rows=3 --max-memory-rows=3 --values=2],
[0], [ignore], [ignore])
m4_define([SPARSE_XARRAY_ON_DISK],
[AT_SETUP([on-disk sparse_xarray max-memory-rows=$1])
- AT_CHECK([sparse-xarray-test$EXEEXT \
+ AT_CHECK([sparse-xarray-test \
--verbosity=0 --queue-limit=`sparse_xarray_queue_limit` \
--columns=2 --max-rows=3 --max-memory-rows=$1 --values=2],
[0], [ignore], [ignore])
AT_SETUP([copying between in-memory sparse_xarrays])
AT_KEYWORDS([sparse_xarray])
-AT_CHECK([sparse-xarray-test$EXEEXT \
+AT_CHECK([sparse-xarray-test \
--verbosity=0 --queue-limit=`sparse_xarray_queue_limit` \
--columns=2 --max-rows=2 --max-memory-rows=2 --values=2 \
--xarrays=2 --no-write-rows --no-copy-columns],
[AT_SETUP([copying between on-disk sparse_xarrays max-memory-rows=$1])
AT_KEYWORDS([sparse_xarray])
limit=`sparse_xarray_queue_limit`
- AT_CHECK([sparse-xarray-test$EXEEXT \
+ AT_CHECK([sparse-xarray-test \
--verbosity=0 --queue-limit=`expr $limit / 2` \
--columns=1 --max-rows=2 --max-memory-rows=$max_memory_rows \
--values=2 --xarrays=2 --no-write-rows --no-copy-columns],
[AT_CHECK([($1) \
&& exit 77 || exit 0], [0], [ignore], [ignore])])])
+m4_divert_text([PREPARE_TESTS], [dnl
+if test X"$RUNNER" != X; then
+ wrapper_dir=`pwd`/wrappers
+ rm "$wrapper_dir"/*
+ test -d "$wrapper_dir" || mkdir "$wrapper_dir"
+
+ wrap_dir () {
+ test -d "$1" || return
+ for file in "$1"/*; do
+ if test -x "$file" && test -f "$file"; then
+ base=`basename $file $EXEEXT`
+ wrapper=$wrapper_dir/$base
+ if test ! -e "$wrapper"; then
+ echo "exec $RUNNER $file \"\$@\"" > $wrapper
+ chmod +x $wrapper
+ fi
+ fi
+ done
+ }
+
+ save_IFS=$IFS; IFS=$PATH_SEPARATOR
+ for dir in $AUTOTEST_PATH; do
+ IFS=$save_IFS
+ test X"$dir" = X && dir=.
+ case $dir in
+ [\\/]* | ?:[\\/]*)
+ wrap_dir "$dir"
+ ;;
+ *)
+ wrap_dir "$abs_top_builddir/$dir"
+ wrap_dir "$abs_top_srcdir/$dir"
+ ;;
+ esac
+ done
+ IFS=$save_IFS
+ PATH=$wrapper_dir:$PATH
+fi
+])
+++ /dev/null
-#! /bin/sh
-
-program=`basename "$0"`
-
-new_PATH=
-save_IFS=$IFS
-IFS=:
-found=no
-for dir in $PATH; do
- IFS=$save_IFS
- if test "X$dir" = X; then
- dir=.
- fi
- if test -x "$dir/$program"; then
- if test $found = no; then
- found=yes
- continue
- else
- if test "X$next_program" = X; then
- next_program=$dir/$program
- fi
- fi
- fi
-done
-IFS=$save_IFS
-
-if test $found = no; then
- echo "$0: $program not found in PATH ($PATH)" >&2
- exit 1
-elif test "X$next_program" = X; then
- echo "$0: $program found only once in PATH ($PATH)" >&2
- exit 1
-fi
-
-: ${VALGRIND:=libtool --mode=execute valgrind --log-file=valgrind.%p --leak-check=full --num-callers=20}
-exec $VALGRIND $next_program "$@"
-echo "$0: $VALGRIND $wrap_program $* failed" >&2
-exit 1