Build (not test) the unittests as part of a normal build.
authorDaniel Dunbar <daniel@zuster.org>
Sun, 13 Sep 2009 22:39:27 +0000 (22:39 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Sun, 13 Sep 2009 22:39:27 +0000 (22:39 +0000)
 - 'make unittests' still builds and tests.
 - 'make unitcheck' inside a unittest directory runs the tests in that directory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81725 91177308-0d34-0410-b5e6-96231b3b80d8

Makefile
Makefile.rules
unittests/Makefile.unittest

index b8d4367e72be2bca3a8b497673eb7823179d8a33..03ab0446522a55dff64c73aa62b687fb16474cce 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -24,7 +24,7 @@ ifeq ($(BUILD_DIRS_ONLY),1)
   OPTIONAL_DIRS :=
 else
   DIRS := lib/System lib/Support utils lib/VMCore lib tools/llvm-config \
-          tools runtime docs
+          tools runtime docs unittests
   OPTIONAL_DIRS := examples projects bindings
 endif
 
index 8d1e621845a03bc0fa6fed0b1f36a0e587ec7a8d..7999c7a3ca92c5cfc35bc5783cddecfe4708b06c 100644 (file)
 #--------------------------------------------------------------------
 # Define the various target sets
 #--------------------------------------------------------------------
-RecursiveTargets := all clean clean-all install uninstall install-bytecode
+RecursiveTargets := all clean clean-all install uninstall install-bytecode \
+                    unitcheck
 LocalTargets     := all-local clean-local clean-all-local check-local \
                     install-local printvars uninstall-local \
-                   install-bytecode-local unittests
+                   install-bytecode-local
 TopLevelTargets  := check dist dist-check dist-clean dist-gzip dist-bzip2 \
                     dist-zip unittests
 UserTargets      := $(RecursiveTargets) $(LocalTargets) $(TopLevelTargets)
@@ -800,6 +801,7 @@ clean-all:: $(addsuffix /.makeclean-all,$(PARALLEL_DIRS))
 install  :: $(addsuffix /.makeinstall  ,$(PARALLEL_DIRS))
 uninstall:: $(addsuffix /.makeuninstall,$(PARALLEL_DIRS))
 install-bytecode  :: $(addsuffix /.makeinstall-bytecode,$(PARALLEL_DIRS))
+unitcheck:: $(addsuffix /.makeunitcheck,$(PARALLEL_DIRS))
 
 ParallelTargets := $(foreach T,$(RecursiveTargets),%/.make$(T))
 
@@ -1619,7 +1621,7 @@ 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 ; \
+           $(MAKE) -C $(PROJ_OBJ_ROOT)/unittests unitcheck; \
          else \
            $(EchoCmd) No Makefile in unittests directory ; \
          fi ; \
index 1c75e44d0778ddf11e3f728268e532951716dc76..355e6a34f51cb5c67d37ed140d1842e53863226b 100644 (file)
@@ -30,6 +30,8 @@ $(LLVMUnitTestExe): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)
           $(StripWarnMsg)
 
 all:: $(LLVMUnitTestExe)
+
+unitcheck:: $(LLVMUnitTestExe)
        $(LLVMUnitTestExe)
 
 endif