summaryrefslogtreecommitdiff
path: root/tests/cond4.test
diff options
context:
space:
mode:
authorRichard Boulton <richard@tartarus.org>2001-08-08 17:42:26 +0000
committerRichard Boulton <richard@tartarus.org>2001-08-08 17:42:26 +0000
commitacb2e40211b716d2e71e8c5926d3940c772f7566 (patch)
tree01b699eb11605185a9d8db09732e52499e88533f /tests/cond4.test
parent2b74c0b603526c17ce47f3beabe07fa82e52de66 (diff)
downloadautomake-acb2e40211b716d2e71e8c5926d3940c772f7566.tar.gz
2001-08-08 Richard Boulton <richard@tartarus.org>
* tests/cond18.test: New file. * tests/cond19.test: New file. * tests/cond20.test: New file. * tests/cond4.test: Updated to check the generated _OBJECTS more thoroughly. * tests/Makefile.am (TESTS): Added cond18.test, cond19.test and cond20.test
Diffstat (limited to 'tests/cond4.test')
-rwxr-xr-xtests/cond4.test38
1 files changed, 33 insertions, 5 deletions
diff --git a/tests/cond4.test b/tests/cond4.test
index 51a13e4ca..fd268542e 100755
--- a/tests/cond4.test
+++ b/tests/cond4.test
@@ -5,10 +5,11 @@
. $srcdir/defs || exit 1
cat > configure.in << 'END'
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+AC_INIT(Makefile.am)
+AM_INIT_AUTOMAKE(foo,0.0)
AC_PROG_CC
-AM_CONDITIONAL(ONE, true)
-AM_CONDITIONAL(TWO, false)
+AM_CONDITIONAL(ONE, test "x$CONDITION1" = "xtrue")
+AM_CONDITIONAL(TWO, test "x$CONDITION2" = "xtrue")
AC_OUTPUT(Makefile)
END
@@ -24,9 +25,36 @@ OPT2 = two.c
endif
targ_SOURCES = main.c $(OPT1) $(OPT2)
+
+echo-objects:
+ @echo $(targ_OBJECTS)
END
+$needs_autoconf
+
$ACLOCAL || exit 1
$AUTOMAKE || exit 1
-
-test "`grep TWO_FALSE Makefile.in | wc -l`" -eq 2
+test "`grep TWO_FALSE Makefile.in | wc -l`" -eq 2 || exit 1
+
+$AUTOCONF || exit 1
+(gcc -v) > /dev/null 2>&1 || exit 77
+$needs_gnu_make
+
+CC='gcc' CONDITION1=true CONDITION2=true ./configure || exit 1
+msgtt=`$MAKE --no-print-directory echo-objects`
+CC='gcc' CONDITION1=true CONDITION2=false ./configure || exit 1
+msgtf=`$MAKE --no-print-directory echo-objects`
+CC='gcc' CONDITION1=false CONDITION2=true ./configure || exit 1
+msgft=`$MAKE --no-print-directory echo-objects`
+CC='gcc' CONDITION1=false CONDITION2=false ./configure || exit 1
+msgff=`$MAKE --no-print-directory echo-objects`
+
+echo $msgtt
+echo $msgtf
+echo $msgft
+echo $msgff
+
+test "$msgtt" = "main.o one.o two.o" || exit 1
+test "$msgtf" = "main.o one.o" || exit 1
+test "$msgft" = "main.o two.o" || exit 1
+test "$msgff" = "main.o" || exit 1