mirror of
https://git.openafs.org/openafs.git
synced 2025-01-31 21:47:45 +00:00
41dd504fe1
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 <mmeffie@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
43 lines
1.4 KiB
Makefile
43 lines
1.4 KiB
Makefile
# Build rules for the OpenAFS test suite.
|
|
|
|
srcdir=@srcdir@/../src/external/c-tap-harness/tests
|
|
abs_top_srcdir=@abs_top_srcdir@
|
|
abs_top_builddir=@abs_top_builddir@
|
|
include @TOP_OBJDIR@/src/config/Makefile.config
|
|
include @TOP_OBJDIR@/src/config/Makefile.pthread
|
|
|
|
MODULE_CFLAGS = -DC_TAP_SOURCE='"$(abs_top_srcdir)/tests"' \
|
|
-DC_TAP_BUILD='"$(abs_top_builddir)/tests"'
|
|
|
|
SUBDIRS = tap common auth util cmd volser opr rx
|
|
|
|
all: runtests
|
|
@for A in $(SUBDIRS); do cd $$A && $(MAKE) $@ && cd .. || exit 1; done
|
|
|
|
runtests: runtests.o
|
|
$(AFS_LDRULE) runtests.o
|
|
|
|
runtests.o: $(srcdir)/runtests.c
|
|
$(AFS_CCRULE) $(srcdir)/runtests.c
|
|
|
|
RUNTESTS_V0_DEFAULT=-l $(abs_top_srcdir)/tests/TESTS
|
|
RUNTESTS_V1_DEFAULT=-v -l $(abs_top_srcdir)/tests/TESTS
|
|
|
|
# If $(TESTS) is blank, RUNTESTS_ARGS will expand to RUNTESTS_DEFAULT_, so
|
|
# we'll run our default list of tests. If $(TESTS) is not blank,
|
|
# $(RUNTESTS_DEFAULT_$(TESTS)) will expand into nothing, so RUNTESTS_ARGS will
|
|
# just become effectively $(TESTS).
|
|
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: all runtests
|
|
MAKECHECK=1 $(abs_top_srcdir)/tests/libwrap @TOP_OBJDIR@/lib \
|
|
./runtests $(RUNTESTS_ARGS)
|
|
|
|
install:
|
|
|
|
clean distclean:
|
|
@for A in $(SUBDIRS); do cd $$A && $(MAKE) $@ && cd .. || exit 1; done
|
|
$(RM) -f *.o core runtests
|