]> git.draconx.ca Git - dxcommon.git/commitdiff
Fix autotest snippet with --disable-dependency-tracking.
authorNick Bowler <nbowler@draconx.ca>
Sat, 26 Mar 2022 03:58:29 +0000 (23:58 -0400)
committerNick Bowler <nbowler@draconx.ca>
Sat, 26 Mar 2022 03:58:29 +0000 (23:58 -0400)
When configuring with --disable-dependency-tracking, the .deps
directories are not created by config.status so unconditionally
creating files in there will not work.

We can avoid this problem by adjusting the rule to skip updating
testsuite.P in this configuration.  Add a new test case to expose
the issue.

snippet/autotest.mk
tests/snippets.at

index 10acd7134d8548ef971b8d124f11dfc5ed6f1147..5b3764bbaa82b2624c276c6293669e6a6c8cea5d 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright © 2015,2019-2021 Nick Bowler
+# Copyright © 2015,2019-2022 Nick Bowler
 #
 # Automake fragment to hook up a basic Autotest test suite into the
 # build.  It is expected that a testsuite.at file exists in $(srcdir).
@@ -66,8 +66,10 @@ endif
        $(AM_V_GEN) $(DX_AUTOTEST) -p m4_include -o $@.tmp testsuite.at
        $(AM_V_at) $(DX_AUTOTEST) -t m4_include:'$$1' -o $@.deps.tmp \
          testsuite.at
+if AMDEP
        $(AM_V_at) exec 3<$@.deps.tmp 4>$(DEPDIR)/$(@F).P; \
          while read f <&3; do printf '$@: %s\n%s:\n' "$$f" "$$f" >&4; done
+endif
        $(AM_V_at) mv -f $@.deps.tmp $@.deps
        $(AM_V_at) mv -f $@.tmp $@
 testsuite.deps: testsuite
index 4352725f42a0ba85ae67a4deafa5dbe7444d7514..fe4eb0855a11dcdea87075e921e0de78de42009d 100644 (file)
@@ -59,6 +59,37 @@ AT_CHECK([./configure MAKE=dmake && test -f .deps/testsuite.P], [0], [ignore])
 
 AT_CLEANUP
 
+AT_SETUP([autotest.mk no depfiles])
+
+TEST_CONFIGURE_AC(
+[[AM_INIT_AUTOMAKE([foreign])
+
+AM_SET_DEPDIR
+AM_OUTPUT_DEPENDENCY_COMMANDS
+AM_MAKE_INCLUDE
+AM_DEP_TRACK
+
+DX_AUTOMAKE_COMPAT
+AM_CONDITIONAL([HAVE_AUTOTEST], [:])
+
+AC_CONFIG_FILES([Makefile])
+]])
+
+cp "$srcdir/snippet/autotest.mk" .
+AT_DATA([Makefile.am],
+[[DISTCLEANFILES =
+EXTRA_DIST =
+include $(top_srcdir)/autotest.mk
+]])
+TEST_AUTORECONF
+
+TEST_CONFIGURE([--disable-dependency-tracking])
+
+AT_DATA([testsuite.at])
+AT_CHECK([make -s AUTOTEST="$srcdir/t/autotest.sh" testsuite])
+
+AT_CLEANUP
+
 AT_SETUP([glconfig.mk no depfiles])
 
 TEST_CONFIGURE_AC(