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
|
|
|
|
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
|
|
|
# For the clang-tidy libclang integration test.
|
|
|
|
c-index-test
|
|
|
|
# clang-tidy tests require it.
|
|
|
|
clang-headers
|
2017-08-29 13:58:08 +08:00
|
|
|
|
2018-10-02 04:24:22 +08:00
|
|
|
clang-tidy
|
|
|
|
)
|
2017-08-29 13:58:08 +08:00
|
|
|
|
2018-10-03 01:22:11 +08:00
|
|
|
set(CLANGD_TEST_DEPS
|
|
|
|
clangd
|
|
|
|
ClangdTests
|
|
|
|
# clangd-related tools which don't have tests, add them to the test to make
|
|
|
|
# sure we don't introduce new changes that break their compilations.
|
|
|
|
clangd-indexer
|
|
|
|
dexp
|
|
|
|
)
|
|
|
|
foreach(clangd_dep ${CLANGD_TEST_DEPS})
|
|
|
|
list(APPEND CLANG_TOOLS_TEST_DEPS
|
|
|
|
${clangd_dep})
|
|
|
|
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")
|
[clangd] Add "check-clangd" target
Summary:
So we don't have to run "check-clang-tools" (which builds and tests all
clang tools) to verify our clangd-related change. It'd save waiting time for
clangd developers.
check-clangd (build ~1000 files, run ~340 tests) vs check-clang-tools (build
~3000 files, run ~1000 tests).
In the future, we probably want to add similar target for other
clang-tools (e.g. clang-tidy).
Reviewers: sammccall
Subscribers: mgorny, ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D52710
llvm-svn: 343474
2018-10-01 22:02:02 +08:00
|
|
|
|
|
|
|
# Setup an individual test for building and testing clangd-only stuff.
|
2018-10-03 01:22:11 +08:00
|
|
|
# Note: all clangd tests have been covered in check-clang-tools, this is a
|
|
|
|
# convenient target for clangd developers.
|
|
|
|
# Exclude check-clangd from check-all.
|
2018-10-02 04:21:41 +08:00
|
|
|
set(EXCLUDE_FROM_ALL ON)
|
[clangd] Add "check-clangd" target
Summary:
So we don't have to run "check-clang-tools" (which builds and tests all
clang tools) to verify our clangd-related change. It'd save waiting time for
clangd developers.
check-clangd (build ~1000 files, run ~340 tests) vs check-clang-tools (build
~3000 files, run ~1000 tests).
In the future, we probably want to add similar target for other
clang-tools (e.g. clang-tidy).
Reviewers: sammccall
Subscribers: mgorny, ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D52710
llvm-svn: 343474
2018-10-01 22:02:02 +08:00
|
|
|
add_lit_testsuite(check-clangd "Running the Clangd regression tests"
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/Unit/clangd;${CMAKE_CURRENT_BINARY_DIR}/clangd
|
|
|
|
DEPENDS ${CLANGD_TEST_DEPS}
|
|
|
|
)
|
|
|
|
set_target_properties(check-clangd PROPERTIES FOLDER "Clangd tests")
|
2018-10-02 04:21:41 +08:00
|
|
|
set(EXCLUDE_FROM_ALL OFF)
|