From: Alex Smith Date: Fri, 3 Sep 2010 01:08:31 +0000 (+0100) Subject: Get -F working again, add a regression test for it X-Git-Tag: 0.29~41^2~3 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=9f4d16089dbc54c10d7acf9c4a809c2b727cf895;p=intercal.git Get -F working again, add a regression test for it -F tends to break particularly often (it was broken by accident due to changes to autoconf and to perpet.c); hopefully the regression test (using beer.i) will catch problems with -F in future. --- diff --git a/pit/Makefile b/pit/Makefile index 61b77db..01f25a1 100644 --- a/pit/Makefile +++ b/pit/Makefile @@ -102,7 +102,8 @@ TARGETS = $(BASE2SOURCES:.i=) \ # For instructions on test conventions, see the header comment of regresscheck test: $(TARGETS) - @$(PIT)/beer | $(PIT)/regresscheck $(PIT)/beer + @$(PIT)/beer | $(PIT)/regresscheck $(PIT)/beer + @file $(PIT)/beer | grep -q 'shell script' || echo "Regression test of -F (using beer) FAILED." @cat $(PIT)/bubble.tst | $(PIT)/bubble | $(PIT)/regresscheck $(PIT)/bubble @cat $(PIT)/fft-delta.tst | $(PIT)/fft | $(PIT)/regresscheck $(PIT)/fft-delta @cat $(PIT)/fft-tophat.tst | $(PIT)/fft | $(PIT)/regresscheck $(PIT)/fft-tophat @@ -134,7 +135,9 @@ test: $(TARGETS) @echo "Tests complete." -# Some tests need options to compile extensions. +# Some tests need options to compile extensions; some test extensions. +$(PIT)/beer: $(PIT)/beer.i + $(ICK) -F $(PIT)/beer.i $(PIT)/pass: $(PIT)/pass.i $(ICK) -m $(PIT)/pass.i $(PIT)/tests/compucome: $(PIT)/tests/compucome.i diff --git a/src/cooptsh.in b/src/cooptsh.in index 2b0622c..b06cf12 100644 --- a/src/cooptsh.in +++ b/src/cooptsh.in @@ -33,14 +33,12 @@ # ########################################################################### -rm icktemp.out >/dev/null 2>/dev/null -if $1@EXEEXT@ +mystery >icktemp.out 2>/dev/null ; then : ; else -rm icktemp.out ; exit 0 ; fi -if grep 'ickoutTERM???!' icktemp.out ; then rm icktemp.out ; exit 0 ; fi -echo 'ickoutTERM???!' >> icktemp.out +rm -f icktemp.out >/dev/null 2>/dev/null +if `readlink -f $1@EXEEXT@` +mystery >icktemp.out 2>/dev/null ; then : ; else +echo Execution of $1@EXEEXT@ failed. +rm -f icktemp.out ; exit 0 ; fi rm $1@EXEEXT@ -echo "#! /bin/sh -cat <<'ickoutTERM???!'" | cat - icktemp.out > $1@EXEEXT@ +echo '#! /bin/sh +tail -n+3 $0; exit 0' | cat - icktemp.out > $1@EXEEXT@ chmod +x $1@EXEEXT@ -rm icktemp.out exit 0 diff --git a/src/perpet.c b/src/perpet.c index 18d2ae1..61fb011 100644 --- a/src/perpet.c +++ b/src/perpet.c @@ -175,9 +175,11 @@ struct linerange_t { int start, end; char *libname; }; +/* Note! "syslib" must be last in this list, as other parts of perpet.c + care about whether syslib in particular was included. */ struct linerange_t lineranges[] = { - {1000, 1999, "syslib"}, /* the system library */ {5000, 5699, "floatlib"}, /* the floating-point support */ + {1000, 1999, "syslib"}, /* the system library */ {0, 0, NULL}, }; @@ -1557,8 +1559,9 @@ static void run_coopt(/*@observer@*/ /*@null@*/ /*@unused@*/ const char* cooptsh /*@observer@*/ /*@unused@*/ const char* binaryname) { /* Note: Params are marked unused because they may not be used if sh isn't supported. */ -#ifdef HAVE_PROG_SH -# ifdef HAVE_SYS_INTERPRETER + /* Assume that sh exists if #! does; sh is needed to run autoconf, so this would + otherwise have to be set by hand anyway. */ +#ifdef HAVE_SYS_INTERPRETER if(coopt) /* AIS */ { /* The constant-output optimizer is a form of post-processor. @@ -1576,7 +1579,6 @@ static void run_coopt(/*@observer@*/ /*@null@*/ /*@unused@*/ const char* cooptsh neccesary */ } } -# endif #endif }