diff options
Diffstat (limited to 't/check7.sh')
-rw-r--r-- | t/check7.sh | 48 |
1 files changed, 44 insertions, 4 deletions
diff --git a/t/check7.sh b/t/check7.sh index dad0e9f0e..d34ae62cd 100644 --- a/t/check7.sh +++ b/t/check7.sh @@ -30,10 +30,22 @@ TESTS = $(XFAIL_TESTS) XFAIL_TESTS = a b c d check_PROGRAMS = a c d check_SCRIPTS = b +EXTRA_PROGRAMS = new old EXTRA_DIST = $(check_SCRIPTS) -expect-xfail-tests: - is $(XFAIL_TESTS) == a$(EXEEXT) b c$(EXEEXT) d$(EXEEXT) +prepare-for-fake-exeext: + rm -f out.new out.old + touch a.fake c.fake d.fake + mv -f new$(EXEEXT) new.fake + mv -f old$(EXEEXT) old.fake +post-check-for-fake-exeext: + test -f new.fake + test -f old.fake + test ! -f new + test ! -f new$(EXEEXT) + test ! -f old + test ! -f old$(EXEEXT) +.PHONY: prepare-for-fake-exeext post-check-for-fake-exeext END cat > b <<'END' @@ -53,14 +65,42 @@ END cp a.c c.c cp a.c d.c +cat > new.c <<'END' +#include <stdio.h> +int main (void) +{ + FILE *fp = fopen ("out.new", "w"); + fprintf (fp, "%s!\n", "Hello, Brave New World"); + return (fclose (fp) != 0); +} +END + +cat > old.c <<'END' +#include <stdio.h> +int main (void) +{ + FILE *fp = fopen ("out.old", "w"); + fprintf (fp, "%s!\n", "Hello, Europe"); + return (fclose (fp) == 0); +} +END + $ACLOCAL $AUTOCONF $AUTOMAKE -a ./configure $MAKE check -run_make expect-xfail-tests -run_make expect-xfail-tests EXEEXT=.bin + +$MAKE check TESTS='old new' XFAIL_TESTS=old +grep 'Hello, Brave New World!' out.new +grep 'Hello, Europe!' out.old + +$MAKE prepare-for-fake-exeext +$MAKE check TESTS='old new' EXEEXT=.fake XFAIL_TESTS=old +$MAKE post-check-for-fake-exeext +grep 'Hello, Brave New World!' out.new +grep 'Hello, Europe!' out.old $MAKE distcheck |