aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2009-01-04 23:12:21 +0000
committerBill Wendling <isanbard@gmail.com>2009-01-04 23:12:21 +0000
commit4113bd1dc6032f9559fa58c61d5cc7d9a8c079be (patch)
treec8ca655a8927f0e711e96b6345b4887e42c69189
parent7e638cd36691e79f3252e5da0e77317f42440ac7 (diff)
Modify the unittests Makefiles so that they don't rebuild parts of LLVM just to
run the tests. Most of this was stolen from the llvm/test Makefiles. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61648 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--Makefile3
-rw-r--r--Makefile.rules21
-rw-r--r--autoconf/configure.ac1
-rw-r--r--unittests/Makefile3
4 files changed, 23 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 5987b88f77..d453330a2e 100644
--- a/Makefile
+++ b/Makefile
@@ -116,7 +116,6 @@ dist-hook::
tools-only: all
libs-only: all
install-libs: install
-unittests: all
#------------------------------------------------------------------------
# Make sure the generated headers are up-to-date. This must be kept in
@@ -185,7 +184,7 @@ update:
$(SVN) $(SVN-UPDATE-OPTIONS) update $(LLVM_SRC_ROOT)
@ $(SVN) status $(LLVM_SRC_ROOT) | $(SUB-SVN-DIRS) | xargs $(SVN) $(SVN-UPDATE-OPTIONS) update
-happiness: update all check
+happiness: update all check unittests
.PHONY: srpm rpm update happiness
diff --git a/Makefile.rules b/Makefile.rules
index 3c9bb5e4cc..313f5598da 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -22,9 +22,9 @@
RecursiveTargets := all clean clean-all install uninstall install-bytecode
LocalTargets := all-local clean-local clean-all-local check-local \
install-local printvars uninstall-local \
- install-bytecode-local
+ install-bytecode-local unittests
TopLevelTargets := check dist dist-check dist-clean dist-gzip dist-bzip2 \
- dist-zip
+ dist-zip unittests
UserTargets := $(RecursiveTargets) $(LocalTargets) $(TopLevelTargets)
InternalTargets := preconditions distdir dist-hook
@@ -1416,6 +1416,22 @@ check::
fi
###############################################################################
+# UNITTESTS: Running the unittests test suite
+###############################################################################
+
+unittests::
+ $(Verb) if test -d "$(PROJ_OBJ_ROOT)/unittests" ; then \
+ if test -f "$(PROJ_OBJ_ROOT)/unittests/Makefile" ; then \
+ $(EchoCmd) Running unittests test suite ; \
+ $(MAKE) -C $(PROJ_OBJ_ROOT)/unittests ; \
+ else \
+ $(EchoCmd) No Makefile in unittests directory ; \
+ fi ; \
+ else \
+ $(EchoCmd) No unittests directory ; \
+ fi
+
+###############################################################################
# DISTRIBUTION: Handle construction of a distribution tarball
###############################################################################
@@ -1503,6 +1519,7 @@ dist-check:: $(DistTarGZip)
--srcdir=../$(DistName) $(DIST_CHECK_CONFIG_OPTIONS) && \
$(MAKE) all && \
$(MAKE) check && \
+ $(MAKE) unittests && \
$(MAKE) install && \
$(MAKE) uninstall && \
$(MAKE) dist-clean && \
diff --git a/autoconf/configure.ac b/autoconf/configure.ac
index 2054548979..c9bd8f2513 100644
--- a/autoconf/configure.ac
+++ b/autoconf/configure.ac
@@ -1029,6 +1029,7 @@ AC_CONFIG_MAKEFILE(lib/Makefile)
AC_CONFIG_MAKEFILE(runtime/Makefile)
AC_CONFIG_MAKEFILE(test/Makefile)
AC_CONFIG_MAKEFILE(test/Makefile.tests)
+AC_CONFIG_MAKEFILE(unittests/Makefile)
AC_CONFIG_MAKEFILE(tools/Makefile)
AC_CONFIG_MAKEFILE(utils/Makefile)
AC_CONFIG_MAKEFILE(projects/Makefile)
diff --git a/unittests/Makefile b/unittests/Makefile
index 33f3c8ebaa..d96df4f52d 100644
--- a/unittests/Makefile
+++ b/unittests/Makefile
@@ -8,6 +8,7 @@
##===----------------------------------------------------------------------===##
LEVEL = ..
+
include $(LEVEL)/Makefile.config
LIBRARYNAME = UnitTestMain
@@ -20,4 +21,4 @@ PARALLEL_DIRS = ADT
include $(LEVEL)/Makefile.common
clean::
- $(RM) -f *Tests
+ $(Verb) $(RM) -f *Tests