summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/Makefile
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2013-03-07 10:09:47 +0000
committerChandler Carruth <chandlerc@gmail.com>2013-03-07 10:09:47 +0000
commit074a3568fca118fd59fdc8d1729580d5ad295654 (patch)
tree50caaa5321d5edd362ce8699bf2e901edf5e7285 /clang-tools-extra/Makefile
parent99ee0f4790654e6df4609f5b9895db0c37dcefa6 (diff)
downloadbcm5719-llvm-074a3568fca118fd59fdc8d1729580d5ad295654.tar.gz
bcm5719-llvm-074a3568fca118fd59fdc8d1729580d5ad295654.zip
Switch from autogenerating tests to using the preprocessor.
NOTE: You may need to run 'make clean' or 'ninja -t clean' etc!!! This is due to really nasty bug/interactions between CMake/configure/make/Ninja/LIT... This commit tries to back out the support for generating test cases as part of the build system due to the issues I brought up in post-commit review: 1) It adds a *lot* of complexity and fragility to the build system. See the number of commits required to try to get all the bots happy. 2) It isn't really necessary -- we can already run scripts to generate things with the RUN lines of a test. 3) It makes the tests somewhat harder to debug as they cross between more domains. 4) In almost all cases it isn't really needed or it can be done directly using the preprocessor. I should have been more proactive reviewing this, and I'm really sorry about the churn here. =/ To help keep track of what commits are going where, this backs out most of the non-test-changes from these revisions: r176397 r176373 r176293 r176184 r175744 r175624 r175545 r175544 There were several trivial or cleanup changes to the lit files or other files. Some of these looked ok, but I didn't try to tease them apart... Edwin, if you know what to look for, please carry on with the cleanups there, and sorry for hosing stuff here but I'm not much of a Python person, and so I was erring on the side of cautiously backing out the change. I've tried to preserve the test changes everywhere I could, but review is appreciated here in case I missed some. I then re-wrote the tests to use the preprocessor rather than python to expand to the various bits of code. The nicest part of this is that now all the files are just C++ code. They edit and behave like C++ code, etc. RUN lines with different -D flags are used to run the same test over multiple different configurations, and includes bracketed in special defines are used to flesh out a collection of standard interface stubs to test interactions between pieces. These probably aren't perfect yet, but I think its an improvement (at least in terms of build system complexity) and will hopefully be a useful demonstration of the technique I prefer for these types of tests. llvm-svn: 176627
Diffstat (limited to 'clang-tools-extra/Makefile')
-rw-r--r--clang-tools-extra/Makefile28
1 files changed, 21 insertions, 7 deletions
diff --git a/clang-tools-extra/Makefile b/clang-tools-extra/Makefile
index 602f146ee08..dfbca69e975 100644
--- a/clang-tools-extra/Makefile
+++ b/clang-tools-extra/Makefile
@@ -12,15 +12,29 @@ CLANG_LEVEL := ../..
include $(CLANG_LEVEL)/../../Makefile.config
PARALLEL_DIRS := remove-cstr-calls tool-template clang-format cpp11-migrate
-DIRS := test
include $(CLANG_LEVEL)/Makefile
-# Custom target. Pass request to test/Makefile that knows what to do. To access
-# this target you'd issue:
-#
-# make -C <build_dir>/tools/clang/tools/extra test
+###
+# Handle the nested test suite.
+
+ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
+$(RecursiveTargets)::
+ $(Verb) for dir in test; do \
+ if [ -f $(PROJ_SRC_DIR)/$${dir}/Makefile ] && [ ! -f $${dir}/Makefile ]; then \
+ $(MKDIR) $${dir}; \
+ $(CP) $(PROJ_SRC_DIR)/$${dir}/Makefile $${dir}/Makefile; \
+ fi \
+ done
+endif
+
test::
- @ $(MAKE) -C test test
+ @ $(MAKE) -C test
+
+report::
+ @ $(MAKE) -C test report
+
+clean::
+ @ $(MAKE) -C test clean
-.PHONY: test
+.PHONY: test report clean
OpenPOWER on IntegriCloud