Generated tests are now just a thin layer around other tests.
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 7 Mar 2010 14:48:10 +0000 (15:48 +0100)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 4 Apr 2010 06:47:25 +0000 (08:47 +0200)
* tests/Makefile.am: Rewrite the rule to generate the `*-p.test'
test scripts so that any of them simply includes the corresponding
`*.test' script (after setting `$parallel_tests' to `yes').
* tests/.gitignore: Add wildcard for temporary files used in the
generation of `*-p.test' tests.

ChangeLog
tests/.gitignore
tests/Makefile.am
tests/Makefile.in

index bdfeff3..a5b5426 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2010-04-04  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Generated tests are now just a thin layer around other tests.
+       * tests/Makefile.am: Rewrite the rule to generate the `*-p.test'
+       test scripts so that any of them simply includes the corresponding
+       `*.test' script (after setting `$parallel_tests' to `yes').
+       * tests/.gitignore: Add wildcard for temporary files used in the
+       generation of `*-p.test' tests.
+
 2010-03-30  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        Avoid an unportable use of `$status' shell variable.
index 3c1f990..61b0783 100644 (file)
@@ -6,3 +6,4 @@ parallel-tests.am
 *.log
 *.log-t
 *-p.test
+*-p.test-t
index acc979c..62ad6aa 100644 (file)
@@ -28,11 +28,15 @@ include $(srcdir)/parallel-tests.am
 $(srcdir)/parallel-tests.am: gen-parallel-tests Makefile.am
        $(AM_V_GEN)(cd $(srcdir) && $(SHELL) ./gen-parallel-tests) >$@
 
-$(parallel_tests): $(parallel_tests:-p.test=.test) Makefile.am
+$(parallel_tests): Makefile.am
+       $(AM_V_at)rm -f $@ $@-t
        $(AM_V_GEN)input=`echo $@ | sed 's,.*/,,; s,-p.test$$,.test,'`; \
-       sed 's|^\. \./defs.*|parallel_tests=yes; &|' \
-         < $(srcdir)/$$input >$@
-       $(AM_V_at)chmod a+rx $@
+       { echo '#!/bin/sh'; \
+         echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \
+         echo 'parallel_tests=yes'; \
+         echo ". '$(srcdir)/$$input'"; \
+       } > $@-t
+       $(AM_V_at)chmod a+rx $@-t && mv -f $@-t $@
 
 MAINTAINERCLEANFILES = $(parallel_tests)
 
index 1d70152..295d259 100644 (file)
@@ -1374,11 +1374,15 @@ uninstall-am:
 $(srcdir)/parallel-tests.am: gen-parallel-tests Makefile.am
        $(AM_V_GEN)(cd $(srcdir) && $(SHELL) ./gen-parallel-tests) >$@
 
-$(parallel_tests): $(parallel_tests:-p.test=.test) Makefile.am
+$(parallel_tests): Makefile.am
+       $(AM_V_at)rm -f $@ $@-t
        $(AM_V_GEN)input=`echo $@ | sed 's,.*/,,; s,-p.test$$,.test,'`; \
-       sed 's|^\. \./defs.*|parallel_tests=yes; &|' \
-         < $(srcdir)/$$input >$@
-       $(AM_V_at)chmod a+rx $@
+       { echo '#!/bin/sh'; \
+         echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \
+         echo 'parallel_tests=yes'; \
+         echo ". '$(srcdir)/$$input'"; \
+       } > $@-t
+       $(AM_V_at)chmod a+rx $@-t && mv -f $@-t $@
 
 clean-local: clean-local-check
 .PHONY: clean-local-check