diff options
author | Morgan Deters <mdeters@gmail.com> | 2010-01-27 22:48:03 +0000 |
---|---|---|
committer | Morgan Deters <mdeters@gmail.com> | 2010-01-27 22:48:03 +0000 |
commit | fa58c38371131db68f780c9f6f7e7d3f2e07256a (patch) | |
tree | 2078b54d9ea698d0012f17e996600c23c418b44a /Makefile.subdir | |
parent | 04c345a4debffaa82bd3e360aaf7cb4c6f135ed7 (diff) |
support "make check" in src/ subdirs for unit-testing of just that module; also support synonyms for "make check" globally
Diffstat (limited to 'Makefile.subdir')
-rw-r--r-- | Makefile.subdir | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Makefile.subdir b/Makefile.subdir index 6470510d9..1ac8357f6 100644 --- a/Makefile.subdir +++ b/Makefile.subdir @@ -1,6 +1,8 @@ # -*-makefile-*- include $(topdir)/builds/current builddir = $(topdir)/builds/$(CURRENT_BUILD)/$(srcdir) +unittestdir = $(topdir)/builds/$(CURRENT_BUILD)/test/unit +unittestprefix = $(srcdir:src/%=%) .PHONY: _default_build_ all _default_build_: all @@ -15,3 +17,21 @@ all %: echo 'Run configure first, or type "make" in a configured build directory.'; \ echo; \ fi + +.PHONY: check +check: + @if test -e $(unittestdir); then \ + echo cd $(unittestdir); \ + cd $(unittestdir); \ + echo $(MAKE) TEST_PREFIX=$(unittestprefix)/ $@; \ + $(MAKE) TEST_PREFIX=$(unittestprefix)/ $@; \ + else \ + echo; \ + echo "** ERROR: could not find unit testing dir \`$(unittestdir)'"; \ + echo; \ + exit 1; \ + fi + +# synonyms for "check" +.PHONY: regress regress0 regress1 regress2 regress3 test +regress regress0 regress1 regress2 regress3 test: check |