summaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2013-12-19 07:09:28 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2013-12-19 07:09:28 +0000
commit115654f15c1060af5f657a8aa6494a8e572c163c (patch)
tree99b295f225fb0bfed7406f62a9f6e29058f8b4ca /unittests
parente2c28ad84f45fd19e21a7995a87f124dccc8974d (diff)
Introduce clean-ups in llvm/unittests/Makefile.unittest, to sweep stray *Tests.
Stray *Tests might stay after reverting. FIXME: Could we apply this feature to clang/unittests? FIXME: Implement this feature to CMake. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197661 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/Makefile3
-rw-r--r--unittests/Makefile.unittest16
2 files changed, 15 insertions, 4 deletions
diff --git a/unittests/Makefile b/unittests/Makefile
index bea39c52fbe..0f80814f989 100644
--- a/unittests/Makefile
+++ b/unittests/Makefile
@@ -12,7 +12,8 @@ LEVEL = ..
PARALLEL_DIRS = ADT Analysis Bitcode CodeGen DebugInfo \
ExecutionEngine IR MC Object Option Support Transforms
-include $(LEVEL)/Makefile.common
+include $(LEVEL)/Makefile.config
+include $(LLVM_SRC_ROOT)/unittests/Makefile.unittest
clean::
$(Verb) $(RM) -f *Tests
diff --git a/unittests/Makefile.unittest b/unittests/Makefile.unittest
index bd32aed4b0a..bf3179d3f29 100644
--- a/unittests/Makefile.unittest
+++ b/unittests/Makefile.unittest
@@ -11,13 +11,23 @@
#
##===----------------------------------------------------------------------===##
-# Set up variables for building a unit test.
-ifdef TESTNAME
-
ifndef MAKEFILE_UNITTEST_NO_INCLUDE_COMMON
include $(LEVEL)/Makefile.common
endif
+# Clean up out-of-tree stray unittests for Lit not to pick one up.
+.PHONY: cleanup-local
+cleanup-local:
+ $(Verb) $(FIND) $(filter-out $(PARALLEL_DIRS), $(wildcard *)) -type f \
+ -path '*/$(BuildMode)/*Tests$(EXEEXT)' \
+ -exec rm -f '{}' \;
+
+all:: cleanup-local
+clean:: cleanup-local
+
+# Set up variables for building a unit test.
+ifdef TESTNAME
+
LLVMUnitTestExe = $(BuildMode)/$(TESTNAME)Tests$(EXEEXT)
# Note that these flags are duplicated when building GoogleTest itself in