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
This commit is contained in:
Bill Wendling 2009-01-04 23:12:21 +00:00
parent 7e638cd366
commit 4113bd1dc6
4 changed files with 23 additions and 5 deletions

View File

@ -116,7 +116,6 @@ dist-hook::
tools-only: all tools-only: all
libs-only: all libs-only: all
install-libs: install install-libs: install
unittests: all
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# Make sure the generated headers are up-to-date. This must be kept in # 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) $(SVN-UPDATE-OPTIONS) update $(LLVM_SRC_ROOT)
@ $(SVN) status $(LLVM_SRC_ROOT) | $(SUB-SVN-DIRS) | xargs $(SVN) $(SVN-UPDATE-OPTIONS) update @ $(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 .PHONY: srpm rpm update happiness

View File

@ -22,9 +22,9 @@
RecursiveTargets := all clean clean-all install uninstall install-bytecode RecursiveTargets := all clean clean-all install uninstall install-bytecode
LocalTargets := all-local clean-local clean-all-local check-local \ LocalTargets := all-local clean-local clean-all-local check-local \
install-local printvars uninstall-local \ install-local printvars uninstall-local \
install-bytecode-local install-bytecode-local unittests
TopLevelTargets := check dist dist-check dist-clean dist-gzip dist-bzip2 \ TopLevelTargets := check dist dist-check dist-clean dist-gzip dist-bzip2 \
dist-zip dist-zip unittests
UserTargets := $(RecursiveTargets) $(LocalTargets) $(TopLevelTargets) UserTargets := $(RecursiveTargets) $(LocalTargets) $(TopLevelTargets)
InternalTargets := preconditions distdir dist-hook InternalTargets := preconditions distdir dist-hook
@ -1415,6 +1415,22 @@ check::
$(EchoCmd) No test directory ; \ $(EchoCmd) No test directory ; \
fi 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 # DISTRIBUTION: Handle construction of a distribution tarball
############################################################################### ###############################################################################
@ -1503,6 +1519,7 @@ dist-check:: $(DistTarGZip)
--srcdir=../$(DistName) $(DIST_CHECK_CONFIG_OPTIONS) && \ --srcdir=../$(DistName) $(DIST_CHECK_CONFIG_OPTIONS) && \
$(MAKE) all && \ $(MAKE) all && \
$(MAKE) check && \ $(MAKE) check && \
$(MAKE) unittests && \
$(MAKE) install && \ $(MAKE) install && \
$(MAKE) uninstall && \ $(MAKE) uninstall && \
$(MAKE) dist-clean && \ $(MAKE) dist-clean && \

View File

@ -1029,6 +1029,7 @@ AC_CONFIG_MAKEFILE(lib/Makefile)
AC_CONFIG_MAKEFILE(runtime/Makefile) AC_CONFIG_MAKEFILE(runtime/Makefile)
AC_CONFIG_MAKEFILE(test/Makefile) AC_CONFIG_MAKEFILE(test/Makefile)
AC_CONFIG_MAKEFILE(test/Makefile.tests) AC_CONFIG_MAKEFILE(test/Makefile.tests)
AC_CONFIG_MAKEFILE(unittests/Makefile)
AC_CONFIG_MAKEFILE(tools/Makefile) AC_CONFIG_MAKEFILE(tools/Makefile)
AC_CONFIG_MAKEFILE(utils/Makefile) AC_CONFIG_MAKEFILE(utils/Makefile)
AC_CONFIG_MAKEFILE(projects/Makefile) AC_CONFIG_MAKEFILE(projects/Makefile)

View File

@ -8,6 +8,7 @@
##===----------------------------------------------------------------------===## ##===----------------------------------------------------------------------===##
LEVEL = .. LEVEL = ..
include $(LEVEL)/Makefile.config include $(LEVEL)/Makefile.config
LIBRARYNAME = UnitTestMain LIBRARYNAME = UnitTestMain
@ -20,4 +21,4 @@ PARALLEL_DIRS = ADT
include $(LEVEL)/Makefile.common include $(LEVEL)/Makefile.common
clean:: clean::
$(RM) -f *Tests $(Verb) $(RM) -f *Tests