2012-08-07 16:33:04 +08:00
|
|
|
# Test runner infrastructure for Clang-based tools. This configures the Clang
|
|
|
|
# test trees for use by Lit, and delegates to LLVM's lit test handlers.
|
2012-08-07 15:09:14 +08:00
|
|
|
#
|
2012-08-07 16:33:04 +08:00
|
|
|
# Note that currently we don't support stand-alone builds of Clang, you must
|
|
|
|
# be building Clang from within a combined LLVM+Clang checkout..
|
2012-08-07 15:09:14 +08:00
|
|
|
|
2012-08-07 16:33:04 +08:00
|
|
|
set(CLANG_TOOLS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..")
|
|
|
|
set(CLANG_TOOLS_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/..")
|
2012-08-07 15:09:14 +08:00
|
|
|
|
2014-01-19 19:19:07 +08:00
|
|
|
if (CMAKE_CFG_INTDIR STREQUAL ".")
|
|
|
|
set(LLVM_BUILD_MODE ".")
|
|
|
|
else ()
|
|
|
|
set(LLVM_BUILD_MODE "%(build_mode)s")
|
|
|
|
endif ()
|
|
|
|
|
2014-01-19 21:00:01 +08:00
|
|
|
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} CLANG_TOOLS_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
|
2014-01-19 19:19:07 +08:00
|
|
|
|
2017-08-29 13:58:08 +08:00
|
|
|
llvm_canonicalize_cmake_booleans(
|
|
|
|
CLANG_ENABLE_STATIC_ANALYZER)
|
|
|
|
|
2013-02-20 03:08:10 +08:00
|
|
|
configure_lit_site_cfg(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
|
|
|
|
)
|
|
|
|
|
2013-04-03 23:11:08 +08:00
|
|
|
configure_lit_site_cfg(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
|
|
|
|
)
|
|
|
|
|
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
2013-03-07 18:09:47 +08:00
|
|
|
option(CLANG_TOOLS_TEST_USE_VG "Run Clang tools' tests under Valgrind" OFF)
|
|
|
|
if(CLANG_TOOLS_TEST_USE_VG)
|
|
|
|
set(CLANG_TOOLS_TEST_EXTRA_ARGS ${CLANG_TEST_EXTRA_ARGS} "--vg")
|
|
|
|
endif()
|
|
|
|
|
2012-08-07 16:33:04 +08:00
|
|
|
set(CLANG_TOOLS_TEST_DEPS
|
2017-07-01 00:58:36 +08:00
|
|
|
# For the clang-apply-replacements test that uses clang-rename.
|
|
|
|
clang-rename
|
2016-03-03 16:58:12 +08:00
|
|
|
|
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
2013-03-07 18:09:47 +08:00
|
|
|
# Individual tools we test.
|
2013-10-31 20:46:10 +08:00
|
|
|
clang-apply-replacements
|
2016-09-20 01:40:32 +08:00
|
|
|
clang-change-namespace
|
2017-02-07 18:28:20 +08:00
|
|
|
clangd
|
2016-04-27 22:32:36 +08:00
|
|
|
clang-include-fixer
|
2016-10-04 17:05:31 +08:00
|
|
|
clang-move
|
2014-02-19 03:46:01 +08:00
|
|
|
clang-query
|
2016-09-02 10:56:07 +08:00
|
|
|
clang-reorder-fields
|
2016-05-31 20:12:19 +08:00
|
|
|
find-all-symbols
|
2013-10-31 20:46:10 +08:00
|
|
|
modularize
|
2013-10-31 20:46:16 +08:00
|
|
|
pp-trace
|
2013-04-03 23:11:08 +08:00
|
|
|
|
|
|
|
# Unit tests
|
|
|
|
ExtraToolsUnitTests
|
2012-08-07 16:33:04 +08:00
|
|
|
)
|
2012-08-07 15:09:14 +08:00
|
|
|
|
2017-08-29 13:58:08 +08:00
|
|
|
if(CLANG_ENABLE_STATIC_ANALYZER)
|
|
|
|
list(APPEND CLANG_TOOLS_TEST_DEPS
|
|
|
|
# For the clang-tidy libclang integration test.
|
|
|
|
c-index-test
|
|
|
|
# clang-tidy tests require it.
|
|
|
|
clang-headers
|
|
|
|
|
|
|
|
clang-tidy
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2017-04-30 11:19:04 +08:00
|
|
|
set(llvm_utils
|
|
|
|
FileCheck count not
|
|
|
|
)
|
|
|
|
|
|
|
|
foreach(t ${llvm_utils})
|
|
|
|
if(TARGET ${t})
|
|
|
|
list(APPEND CLANG_TOOLS_TEST_DEPS ${t})
|
|
|
|
endif()
|
|
|
|
endforeach()
|
2017-03-15 13:55:43 +08:00
|
|
|
|
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
2013-03-07 18:09:47 +08:00
|
|
|
add_lit_testsuite(check-clang-tools "Running the Clang extra tools' regression tests"
|
2012-08-07 16:33:04 +08:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
DEPENDS ${CLANG_TOOLS_TEST_DEPS}
|
|
|
|
ARGS ${CLANG_TOOLS_TEST_EXTRA_ARGS}
|
|
|
|
)
|
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
2013-03-07 18:09:47 +08:00
|
|
|
|
2017-06-29 04:57:28 +08:00
|
|
|
set_target_properties(check-clang-tools PROPERTIES FOLDER "Clang extra tools' tests")
|