summaryrefslogtreecommitdiff
path: root/t/exeext.sh
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2013-06-19 16:09:47 +0200
committerStefano Lattarini <stefano.lattarini@gmail.com>2013-06-19 16:18:58 +0200
commitf387e513e36f2b7858befc4de6b41d7838d94482 (patch)
tree320404d47d42a3df8d0dd8dfe6a2dedc814fc3be /t/exeext.sh
parent3f1d7622a9a4c818d5d0b20d8a52c09754806d99 (diff)
downloadautomake-f387e513e36f2b7858befc4de6b41d7838d94482.tar.gz
tests: simplify checks for some expected variables values in Makefiles
Do so by using our custom 'is' auxiliary script rather than grepping the output from make. This is more natural, more robust, and often shorter to write. Unfortunately, we can't do that in all cases: sometimes we really need to match the content of a variable against a regular expressions, and we can't know nor are interested in its exact value. This is basically a follow-up on commit v1.11-1830-g96401cb of 2012-02-08 (tests: better way to compare lists in Makefile rules). * t/subst-no-trailing-empty-line.sh: Adjust. * t/pluseq10.sh: Likewise. * t/check5.sh: Likewise, and enhance a little while at it. * t/check7.sh: Likewise. * t/exeext.sh: Likewise. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 't/exeext.sh')
-rw-r--r--t/exeext.sh35
1 files changed, 15 insertions, 20 deletions
diff --git a/t/exeext.sh b/t/exeext.sh
index 72902333e..414108d24 100644
--- a/t/exeext.sh
+++ b/t/exeext.sh
@@ -32,7 +32,6 @@ AC_OUTPUT
END
cat > Makefile.am << 'END'
-## Use a different dir for each to make grep easy.
bin_PROGRAMS = maude
sbin_PROGRAMS = maude.static
## We don't define this one for now. Probably it is an error.
@@ -46,11 +45,17 @@ if WANT_RMT
libexec_PROGRAMS = rmt
endif
-print:
- @echo 1BEG: $(bin_PROGRAMS) :END1
- @echo 2BEG: $(sbin_PROGRAMS) :END2
- @echo 3BEG: $(check_PROGRAMS) :END3
- @echo 4BEG: $(libexec_PROGRAMS) :END4
+test-default:
+ is $(bin_PROGRAMS) == maude$(EXEEXT) mt$(EXEEXT)
+ is $(sbin_PROGRAMS) == maude.static$(EXEEXT)
+ is $(check_PROGRAMS) == maude3$(EXEEXT)
+ is $(libexec_PROGRAMS) == rmt$(EXEEXT)
+
+test-revert:
+ is $(bin_PROGRAMS) == maude$(EXEEXT)
+ is $(sbin_PROGRAMS) == maude.static$(EXEEXT)
+ is $(check_PROGRAMS) == maude3$(EXEEXT)
+ is $(libexec_PROGRAMS) ==
END
$ACLOCAL
@@ -68,21 +73,11 @@ test $(grep -c '^bin_PROGRAMS =' Makefile.in) -eq 1
grep 'maude3__EXEEXT__OBJECTS' Makefile.in && exit 1
./configure
-
-run_make -O EXEEXT=.foo print
-
-grep '1BEG: maude.foo mt.foo :END1' stdout
-grep '2BEG: maude.static.foo :END2' stdout
-grep '3BEG: maude3.foo :END3' stdout
-grep '4BEG: rmt.foo :END4' stdout
+run_make test-default
+run_make test-default EXEEXT=.foo
./configure revert=yes
-
-run_make -O EXEEXT=.foo print
-
-grep '1BEG: maude.foo :END1' stdout
-grep '2BEG: maude.static.foo :END2' stdout
-grep '3BEG: maude3.foo :END3' stdout
-grep '4BEG: :END4' stdout
+run_make test-revert
+run_make test-revert EXEEXT=.foo
: