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
|
|
|
|
2020-05-09 00:36:31 +08:00
|
|
|
llvm_canonicalize_cmake_booleans(
|
2020-09-04 07:37:29 +08:00
|
|
|
CLANG_TIDY_ENABLE_STATIC_ANALYZER
|
2020-05-09 00:36:31 +08:00
|
|
|
LIBCLANG_INCLUDE_CLANG_TOOLS_EXTRA
|
|
|
|
)
|
2017-08-29 13:58:08 +08:00
|
|
|
|
2013-02-20 03:08:10 +08:00
|
|
|
configure_lit_site_cfg(
|
2019-03-29 10:46:31 +08:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py
|
|
|
|
MAIN_CONFIG
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py
|
2013-02-20 03:08:10 +08:00
|
|
|
)
|
|
|
|
|
2013-04-03 23:11:08 +08:00
|
|
|
configure_lit_site_cfg(
|
2019-03-29 10:46:31 +08:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py
|
|
|
|
MAIN_CONFIG
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.cfg.py
|
2013-04-03 23:11:08 +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
|
|
|
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
|
|
|
|
2018-03-23 07:34:46 +08:00
|
|
|
# For the clang-doc tests that emit bitcode files.
|
|
|
|
llvm-bcanalyzer
|
|
|
|
|
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
|
2018-03-23 07:34:46 +08:00
|
|
|
clang-doc
|
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 15:09:14 +08:00
|
|
|
|
2018-10-02 04:24:22 +08:00
|
|
|
# clang-tidy tests require it.
|
[build] Rename clang-headers to clang-resource-headers
Summary:
The current install-clang-headers target installs clang's resource
directory headers. This is different from the install-llvm-headers
target, which installs LLVM's API headers. We want to introduce the
corresponding target to clang, and the natural name for that new target
would be install-clang-headers. Rename the existing target to
install-clang-resource-headers to free up the install-clang-headers name
for the new target, following the discussion on cfe-dev [1].
I didn't find any bots on zorg referencing install-clang-headers. I'll
send out another PSA to cfe-dev to accompany this rename.
[1] http://lists.llvm.org/pipermail/cfe-dev/2019-February/061365.html
Reviewers: beanz, phosek, tstellar, rnk, dim, serge-sans-paille
Subscribers: mgorny, javed.absar, jdoerfert, #sanitizers, openmp-commits, lldb-commits, cfe-commits, llvm-commits
Tags: #clang, #sanitizers, #lldb, #openmp, #llvm
Differential Revision: https://reviews.llvm.org/D58791
llvm-svn: 355340
2019-03-05 05:19:53 +08:00
|
|
|
clang-resource-headers
|
2017-08-29 13:58:08 +08:00
|
|
|
|
2018-10-02 04:24:22 +08:00
|
|
|
clang-tidy
|
2019-03-22 21:42:48 +08:00
|
|
|
# Clang-tidy tests need clang for building modules.
|
|
|
|
clang
|
2019-01-16 08:24:22 +08:00
|
|
|
)
|
2020-05-09 00:36:31 +08:00
|
|
|
if (LIBCLANG_INCLUDE_CLANG_TOOLS_EXTRA)
|
|
|
|
# For the clang-tidy libclang integration test.
|
|
|
|
set(CLANG_TOOLS_TEST_DEPS ${CLANG_TOOLS_TEST_DEPS} "c-index-test")
|
|
|
|
endif ()
|
2019-01-16 08:24:22 +08:00
|
|
|
|
2018-11-22 18:14:55 +08:00
|
|
|
# Add lit test dependencies.
|
|
|
|
set(LLVM_UTILS_DEPS
|
|
|
|
FileCheck count not
|
|
|
|
)
|
|
|
|
foreach(dep ${LLVM_UTILS_DEPS})
|
|
|
|
if(TARGET ${dep})
|
2019-04-26 17:20:36 +08:00
|
|
|
list(APPEND CLANG_TOOLS_TEST_DEPS ${dep})
|
2018-11-22 18:14:55 +08:00
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
|
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")
|
2020-09-25 19:32:56 +08:00
|
|
|
|
|
|
|
add_lit_testsuites(CLANG-EXTRA ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
DEPENDS ${CLANG_TOOLS_TEST_DEPS}
|
|
|
|
)
|