From 41dd504fe110f461229b68d25c5d0b4ce6e1d408 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Mon, 7 Jun 2021 16:44:38 -0500 Subject: [PATCH] tests: Remove check/test/tests subdir targets Since commit a62de618 (Build util tests properly with make check), running 'make check' in tests/ also runs 'make check' in each of the tests subdirectories, which builds the tests in that dir. (And the same goes for 'make test' and 'make tests'.) This does ensure that the tests are built before we run them, but it's a bit strange to build the tests under 'make check', a target that usually runs tests. We do this in the top-level tests dir to make sure that the tests are built, but this purpose is served by the existing 'make all' target. So to reduce some duplication of logic, and reduce the number of targets the subdirs need to implement, just have 'make check' depend on 'make all', so we know the tests are built when we go to run them. Change-Id: I2fcbe88daeeae94cd7ef7a4a8326c4b56fadee5a Reviewed-on: https://gerrit.openafs.org/14636 Reviewed-by: Michael Meffie Tested-by: BuildBot Reviewed-by: Benjamin Kaduk --- tests/Makefile.in | 3 +-- tests/auth/Makefile.in | 2 +- tests/cmd/Makefile.in | 2 +- tests/common/Makefile.in | 2 +- tests/opr/Makefile.in | 2 +- tests/rx/Makefile.in | 2 +- tests/tap/Makefile.in | 2 +- tests/util/Makefile.in | 2 +- tests/volser/Makefile.in | 2 +- 9 files changed, 9 insertions(+), 10 deletions(-) diff --git a/tests/Makefile.in b/tests/Makefile.in index 8ed8e3473c..6cd4f669c7 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -31,8 +31,7 @@ RUNTESTS_DEFAULT_=$(RUNTESTS_V$(V)_DEFAULT) RUNTESTS_ARGS=$(RUNTESTS_DEFAULT_$(TESTS)) $(TESTS) # To run specific tests, run e.g. 'make check TESTS="rx/foo opr/foo"' -check test tests: runtests - @for A in $(SUBDIRS); do cd $$A && $(MAKE) $@ && cd .. || exit 1; done +check test tests: all runtests MAKECHECK=1 $(abs_top_srcdir)/tests/libwrap @TOP_OBJDIR@/lib \ ./runtests $(RUNTESTS_ARGS) diff --git a/tests/auth/Makefile.in b/tests/auth/Makefile.in index ffa7f670cb..df73ed4dbb 100644 --- a/tests/auth/Makefile.in +++ b/tests/auth/Makefile.in @@ -8,7 +8,7 @@ BINS = authcon-t superuser-t keys-t realms-t writekeyfile MODULE_CFLAGS=-I$(TOP_OBJDIR) -I$(srcdir)/../common/ -all check test tests: $(BINS) +all: $(BINS) MODULE_LIBS = $(abs_top_builddir)/tests/common/libafstest_common.la \ $(abs_top_builddir)/src/auth/liboafs_auth.la \ diff --git a/tests/cmd/Makefile.in b/tests/cmd/Makefile.in index ede656e342..ac359329b4 100644 --- a/tests/cmd/Makefile.in +++ b/tests/cmd/Makefile.in @@ -14,7 +14,7 @@ LIBS = $(abs_top_builddir)/tests/common/libafstest_common.la \ BINS = command-t -all check test tests: $(BINS) +all: $(BINS) command-t: command-t.o $(LIBS) $(LT_LDRULE_static) command-t.o $(LIBS) $(LIB_roken) $(XLIBS) diff --git a/tests/common/Makefile.in b/tests/common/Makefile.in index f9cdcb03cd..f7a39af206 100644 --- a/tests/common/Makefile.in +++ b/tests/common/Makefile.in @@ -12,7 +12,7 @@ LT_libs = $(LIB_rfc3961) $(LIB_roken) LT_deps = $(top_builddir)/tests/tap/libafstest_tap.la \ $(top_builddir)/src/util/liboafs_util.la -all check test tests: libafstest_common.la +all: libafstest_common.la # This library is just used internally for our tests, so use # LT_LDLIB_shlib_internal so we don't need to manage a .sym export list. diff --git a/tests/opr/Makefile.in b/tests/opr/Makefile.in index 6fecf335d9..33a7cd5b90 100644 --- a/tests/opr/Makefile.in +++ b/tests/opr/Makefile.in @@ -11,7 +11,7 @@ LIBS= $(abs_top_builddir)/tests/common/libafstest_common.la \ BINS = cache-t dict-t fmt-t jhash-t queues-t rbtree-t softsig-helper time-t \ uuid-t -all check test tests: $(BINS) +all: $(BINS) cache-t: cache-t.o $(LIBS) $(LT_LDRULE_static) cache-t.o $(LIBS) $(XLIBS) diff --git a/tests/rx/Makefile.in b/tests/rx/Makefile.in index 88c3f9e761..5af2d171b5 100644 --- a/tests/rx/Makefile.in +++ b/tests/rx/Makefile.in @@ -12,7 +12,7 @@ LIBS = $(abs_top_builddir)/tests/common/libafstest_common.la \ BINS = event-t -all check test tests: $(BINS) +all: $(BINS) event-t: event-t.o $(LIBS) $(LT_LDRULE_static) event-t.o $(LIBS) $(LIB_roken) $(XLIBS) diff --git a/tests/tap/Makefile.in b/tests/tap/Makefile.in index 5ddf41b570..ecb3c62d19 100644 --- a/tests/tap/Makefile.in +++ b/tests/tap/Makefile.in @@ -7,7 +7,7 @@ include @TOP_OBJDIR@/src/config/Makefile.pthread LT_objs = basic.lo -all check test tests: libafstest_tap.la basic.h macros.h libtap.sh +all: libafstest_tap.la basic.h macros.h libtap.sh CFLAGS_basic.lo = @CFLAGS_NOERROR@ -I$(tapdir)/../.. basic.lo: $(tapdir)/basic.c $(tapdir)/basic.h diff --git a/tests/util/Makefile.in b/tests/util/Makefile.in index 271783b3a4..ea4e5c87d7 100644 --- a/tests/util/Makefile.in +++ b/tests/util/Makefile.in @@ -14,7 +14,7 @@ LIBS = $(abs_top_builddir)/tests/common/libafstest_common.la \ BINS = ktime-t exec-alt-t volutil-t -all check test tests: $(BINS) +all: $(BINS) ktime-t: ktime-t.lo $(LIBS) $(LT_LDRULE_static) ktime-t.lo $(LIBS) $(XLIBS) diff --git a/tests/volser/Makefile.in b/tests/volser/Makefile.in index 063003f253..342b1b6983 100644 --- a/tests/volser/Makefile.in +++ b/tests/volser/Makefile.in @@ -8,7 +8,7 @@ BINS = vos-t MODULE_CFLAGS=-I$(TOP_OBJDIR) -I$(srcdir)/../common/ -all check test tests: $(BINS) +all: $(BINS) MODULE_LIBS = $(abs_top_builddir)/tests/common/libafstest_common.la \ $(abs_top_builddir)/src/vlserver/liboafs_vldb.la \