diff options
author | Mike Frysinger <vapier@gentoo.org> | 2021-10-23 18:01:04 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2021-10-23 18:17:09 -0400 |
commit | 38348c15ee54a9d5a6aefeaef9dd41e031271dc0 (patch) | |
tree | 09054846cbf3ba5e45628e9a59205df27f07fffc | |
parent | sandbox: add a --run-configure option (diff) | |
download | sandbox-38348c15ee54a9d5a6aefeaef9dd41e031271dc0.tar.gz sandbox-38348c15ee54a9d5a6aefeaef9dd41e031271dc0.tar.bz2 sandbox-38348c15ee54a9d5a6aefeaef9dd41e031271dc0.zip |
tests: fix handling of srcdir vs abs_srcdir for dist creation
The paths listed in EXTRA_DIST must be the targets that we define
exactly, or running distcheck can fail with stale targets -- they
should have been generated before creating the dist, but they get
updated afterwards. This is easy to repro with:
touch tests/testsuite.at && make distcheck
Let's split the relative & absolute path logic a bit to help with
this. We should only use relative paths in dependency related
settings, but use absolute paths when running tools after a cd to
a different location.
Also add testsuite.list.at to the dist explicitly. We were getting
this implicitly via testsuite depending on it, but better to list
all the files exactly.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r-- | tests/local.mk | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/tests/local.mk b/tests/local.mk index 0aac4f1..aa2acac 100644 --- a/tests/local.mk +++ b/tests/local.mk @@ -1,12 +1,16 @@ AT_FILES = $(wildcard $(top_srcdir)/%D%/*.at) -TESTSUITE = $(abs_top_srcdir)/%D%/testsuite DISTCLEANFILES += %D%/atconfig +# Use top_srcdir for dependencies, and abs_top_srcdir to execute it. +TESTSUITE = $(top_srcdir)/%D%/testsuite +ABS_TESTSUITE = $(abs_top_srcdir)/%D%/testsuite + EXTRA_DIST += \ $(AT_FILES) \ + $(TESTSUITE) \ + $(TESTSUITE_LIST) \ %D%/atlocal.in \ %D%/package.m4.in \ - %D%/testsuite \ %D%/test-skel-0.c \ %D%/tests.h \ %D%/xattr-0 @@ -118,23 +122,23 @@ TESTSUITEFLAGS = --jobs=`getconf _NPROCESSORS_ONLN || echo 1` tests: $(check_PROGRAMS) $(TESTSUITE) check-local: %D%/atconfig %D%/atlocal $(TESTSUITE) - cd %D% && $(SHELL) '$(TESTSUITE)' AUTOTEST_PATH='src:tests' $(TESTSUITEFLAGS) + cd %D% && $(SHELL) '$(ABS_TESTSUITE)' AUTOTEST_PATH='src:tests' $(TESTSUITEFLAGS) installcheck-local: %D%/atconfig %D%/atlocal $(TESTSUITE) - cd %D% && $(SHELL) '$(TESTSUITE)' AUTOTEST_PATH='src:tests:$(bindir)' $(TESTSUITEFLAGS) + cd %D% && $(SHELL) '$(ABS_TESTSUITE)' AUTOTEST_PATH='src:tests:$(bindir)' $(TESTSUITEFLAGS) clean-local: - test ! -f '$(TESTSUITE)' || { cd %D% && $(SHELL) '$(TESTSUITE)' --clean; } + test ! -f '$(TESTSUITE)' || { cd %D% && $(SHELL) '$(ABS_TESTSUITE)' --clean; } TESTSUITE_LIST = $(top_srcdir)/%D%/testsuite.list.at AUTOTEST = $(AUTOM4TE) --language=autotest $(TESTSUITE): $(AT_FILES) $(TESTSUITE_LIST) - @$(MKDIR_P) $(abs_top_srcdir)/%D% - $(AM_V_GEN)cd $(abs_top_srcdir)/%D% && $(AUTOTEST) -I. -o $@.tmp $@.at + @$(MKDIR_P) $(top_srcdir)/%D% + $(AM_V_GEN)cd $(top_srcdir)/%D% && $(AUTOTEST) -I. -o testsuite.tmp testsuite.at $(AM_V_at)mv $@.tmp $@ $(TESTSUITE_LIST): $(AT_FILES) - @$(MKDIR_P) $(abs_top_srcdir)/%D% + @$(MKDIR_P) $(top_srcdir)/%D% $(AM_V_GEN)( echo "dnl DO NOT EDIT: GENERATED BY MAKEFILE.AM"; \ $(GREP) -l -e '^SB_CHECK' -e '^AT_CHECK' $(AT_FILES) | LC_ALL=C sort | \ $(SED) -e 's:^[^/]*/%D%/:sb_inc([:' -e 's:[.]at$$:]):' ) > $@ |