2018-02-21 08:05:51 +08:00
|
|
|
# Test runner infrastructure for LLDB. This configures the LLDB test trees
|
|
|
|
# for use by Lit, and delegates to LLVM's lit test handlers.
|
|
|
|
|
|
|
|
if (CMAKE_CFG_INTDIR STREQUAL ".")
|
|
|
|
set(LLVM_BUILD_MODE ".")
|
|
|
|
else ()
|
|
|
|
set(LLVM_BUILD_MODE "%(build_mode)s")
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (NOT LLDB_TEST_USE_CUSTOM_C_COMPILER)
|
|
|
|
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TEST_C_COMPILER ${LLDB_TEST_C_COMPILER})
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (NOT LLDB_TEST_USE_CUSTOM_CXX_COMPILER)
|
|
|
|
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TEST_CXX_COMPILER ${LLDB_TEST_CXX_COMPILER})
|
|
|
|
endif ()
|
|
|
|
|
2018-05-04 00:54:10 +08:00
|
|
|
get_property(LLDB_DOTEST_ARGS GLOBAL PROPERTY LLDB_DOTEST_ARGS_PROPERTY)
|
|
|
|
|
2018-02-21 08:05:51 +08:00
|
|
|
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_LIBS_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
|
|
|
|
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TOOLS_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
|
2018-05-04 00:54:10 +08:00
|
|
|
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_DOTEST_ARGS "${LLDB_DOTEST_ARGS}")
|
2018-02-21 08:05:51 +08:00
|
|
|
|
2018-05-04 00:54:10 +08:00
|
|
|
list(APPEND LLDB_TEST_DEPS
|
lldb-test symbols: Add ability to do name-based lookup
Summary:
lldb-test already had the ability to dump all symbol information in a
module. This is interesting, but it can be too verbose, and it also does
not use the same APIs that lldb uses to query symbol information. The
last part is interesting to me now, because I am about to add DWARF v5
debug_names support, which needs to implement these APIs.
This patch adds a set of arguments to lldb-test, which modify it's
behavior from dumping all symbols to dumping only the requested
information:
- --find={function,namespace,type,variable} - search for the given
kind of objects.
- --name - the name to search for.
- --regex - whether to treat the "name" as a regular expression. This is
not available for all lookup types (we do not have the required APIs
for namespaces and types).
- --context - specifies the context, which can be used to restrict the
search. This argument takes a variable name (which must be defined and
be unique), and we then use the context that this variable is defined
in as the search context.
- --function-flags={auto,full,base,method,selector} - a set of flags to
further restrict the search for function symbols.
Together, these flags and their combinations cover the main SymbolFile
entry points which I will need to modify for the accelerator table
support, and so I plan to do most of the regression testing this way.
(I've also found this a useful tool for exploration of what the given
APIs are supposed to do.)
I add a couple of tests to demonstrate the usage of the usage of the
various options, and also an xfailed test which demonstrates a bug I
found while playing with this. The only requirement for these tests is
the presence of lld -- the should run on any platform which is able to
build lldb.
These tests use c++ code as input, but this isn't a requirement. It is also
possible to use IR, assembly or json to create the test module.
Reviewers: davide, zturner, asmith, JDevlieghere, clayborg, alexshap
Subscribers: mgorny, aprantl, lldb-commits
Differential Revision: https://reviews.llvm.org/D46318
llvm-svn: 331447
2018-05-03 18:57:16 +08:00
|
|
|
LLDBUnitTests
|
|
|
|
dsymutil
|
2018-09-21 21:40:22 +08:00
|
|
|
llc
|
lldb-test symbols: Add ability to do name-based lookup
Summary:
lldb-test already had the ability to dump all symbol information in a
module. This is interesting, but it can be too verbose, and it also does
not use the same APIs that lldb uses to query symbol information. The
last part is interesting to me now, because I am about to add DWARF v5
debug_names support, which needs to implement these APIs.
This patch adds a set of arguments to lldb-test, which modify it's
behavior from dumping all symbols to dumping only the requested
information:
- --find={function,namespace,type,variable} - search for the given
kind of objects.
- --name - the name to search for.
- --regex - whether to treat the "name" as a regular expression. This is
not available for all lookup types (we do not have the required APIs
for namespaces and types).
- --context - specifies the context, which can be used to restrict the
search. This argument takes a variable name (which must be defined and
be unique), and we then use the context that this variable is defined
in as the search context.
- --function-flags={auto,full,base,method,selector} - a set of flags to
further restrict the search for function symbols.
Together, these flags and their combinations cover the main SymbolFile
entry points which I will need to modify for the accelerator table
support, and so I plan to do most of the regression testing this way.
(I've also found this a useful tool for exploration of what the given
APIs are supposed to do.)
I add a couple of tests to demonstrate the usage of the usage of the
various options, and also an xfailed test which demonstrates a bug I
found while playing with this. The only requirement for these tests is
the presence of lld -- the should run on any platform which is able to
build lldb.
These tests use c++ code as input, but this isn't a requirement. It is also
possible to use IR, assembly or json to create the test module.
Reviewers: davide, zturner, asmith, JDevlieghere, clayborg, alexshap
Subscribers: mgorny, aprantl, lldb-commits
Differential Revision: https://reviews.llvm.org/D46318
llvm-svn: 331447
2018-05-03 18:57:16 +08:00
|
|
|
lldb
|
|
|
|
lldb-test
|
|
|
|
llvm-config
|
|
|
|
llvm-mc
|
|
|
|
llvm-objcopy
|
|
|
|
)
|
|
|
|
|
|
|
|
if(TARGET lld)
|
|
|
|
list(APPEND LLDB_TEST_DEPS lld)
|
|
|
|
set(LLDB_HAVE_LLD 1)
|
|
|
|
else()
|
|
|
|
set(LLDB_HAVE_LLD 0)
|
|
|
|
endif()
|
|
|
|
|
2015-03-14 04:55:07 +08:00
|
|
|
if(BUILD_SHARED_LIBS)
|
|
|
|
set(ENABLE_SHARED 1)
|
|
|
|
else()
|
|
|
|
set(ENABLE_SHARED 0)
|
|
|
|
endif(BUILD_SHARED_LIBS)
|
|
|
|
|
2018-01-09 22:44:04 +08:00
|
|
|
# the value is not canonicalized within LLVM
|
|
|
|
llvm_canonicalize_cmake_booleans(
|
2018-06-06 17:44:14 +08:00
|
|
|
LLDB_DISABLE_PYTHON
|
2018-01-09 22:44:04 +08:00
|
|
|
LLVM_ENABLE_ZLIB)
|
|
|
|
|
2015-03-14 04:55:07 +08:00
|
|
|
configure_lit_site_cfg(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg)
|
|
|
|
configure_lit_site_cfg(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in
|
2018-05-04 00:54:10 +08:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg)
|
|
|
|
configure_lit_site_cfg(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/Suite/lit.site.cfg.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/Suite/lit.site.cfg)
|
2015-03-14 04:55:07 +08:00
|
|
|
|
2016-10-22 02:38:44 +08:00
|
|
|
if(NOT LLDB_BUILT_STANDALONE)
|
2018-05-04 00:54:10 +08:00
|
|
|
list(APPEND LLDB_TEST_DEPS
|
|
|
|
FileCheck
|
|
|
|
not
|
|
|
|
)
|
[LIT] First pass of LLDB LIT support
Summary:
This patch supplies basic infrastructure for LLDB to use LIT, and ports a few basic test cases from the LLDB test suite into LIT.
With this patch the LLDB lit system is not capable or intended to fully replace the existing LLDB test suite, but this first patch enables people to write lit tests for LLDB.
The lit substitution for %cc and %cxx default to the host compiler unless the CMake option LLDB_TEST_CLANG is On, in which case the in-tree clang will be used.
The target check-lldb-lit will run all lit tests including the lit-based executor for the unit tests. Alternatively there is a target generated for each subdirectory under the lit directory, so check-lldb-unit and check-lldb-expr will run just the tests under their respective directories.
The ported tests are not removed from the existing suite, and should not be until such a time when the lit runner is mature and in use by bots and workflows.
Reviewers: zturner, labath, jingham, tfiala
Subscribers: beanz, mgorny, lldb-commits
Differential Revision: https://reviews.llvm.org/D24591
llvm-svn: 281651
2016-09-16 04:13:55 +08:00
|
|
|
endif()
|
|
|
|
|
2015-03-14 04:55:07 +08:00
|
|
|
set(LLDB_TEST_PARAMS
|
|
|
|
lldb_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
|
|
|
|
)
|
|
|
|
|
[LIT] First pass of LLDB LIT support
Summary:
This patch supplies basic infrastructure for LLDB to use LIT, and ports a few basic test cases from the LLDB test suite into LIT.
With this patch the LLDB lit system is not capable or intended to fully replace the existing LLDB test suite, but this first patch enables people to write lit tests for LLDB.
The lit substitution for %cc and %cxx default to the host compiler unless the CMake option LLDB_TEST_CLANG is On, in which case the in-tree clang will be used.
The target check-lldb-lit will run all lit tests including the lit-based executor for the unit tests. Alternatively there is a target generated for each subdirectory under the lit directory, so check-lldb-unit and check-lldb-expr will run just the tests under their respective directories.
The ported tests are not removed from the existing suite, and should not be until such a time when the lit runner is mature and in use by bots and workflows.
Reviewers: zturner, labath, jingham, tfiala
Subscribers: beanz, mgorny, lldb-commits
Differential Revision: https://reviews.llvm.org/D24591
llvm-svn: 281651
2016-09-16 04:13:55 +08:00
|
|
|
add_lit_testsuite(check-lldb-lit "Running lldb lit test suite"
|
2015-03-14 04:55:07 +08:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
PARAMS lldb_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
|
2018-07-17 23:11:15 +08:00
|
|
|
lldb_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
|
2015-03-14 04:55:07 +08:00
|
|
|
DEPENDS ${LLDB_TEST_DEPS}
|
|
|
|
)
|
|
|
|
|
[LIT] First pass of LLDB LIT support
Summary:
This patch supplies basic infrastructure for LLDB to use LIT, and ports a few basic test cases from the LLDB test suite into LIT.
With this patch the LLDB lit system is not capable or intended to fully replace the existing LLDB test suite, but this first patch enables people to write lit tests for LLDB.
The lit substitution for %cc and %cxx default to the host compiler unless the CMake option LLDB_TEST_CLANG is On, in which case the in-tree clang will be used.
The target check-lldb-lit will run all lit tests including the lit-based executor for the unit tests. Alternatively there is a target generated for each subdirectory under the lit directory, so check-lldb-unit and check-lldb-expr will run just the tests under their respective directories.
The ported tests are not removed from the existing suite, and should not be until such a time when the lit runner is mature and in use by bots and workflows.
Reviewers: zturner, labath, jingham, tfiala
Subscribers: beanz, mgorny, lldb-commits
Differential Revision: https://reviews.llvm.org/D24591
llvm-svn: 281651
2016-09-16 04:13:55 +08:00
|
|
|
set_target_properties(check-lldb-lit PROPERTIES FOLDER "LLDB tests")
|
|
|
|
|
2017-10-28 05:22:57 +08:00
|
|
|
# If we're building with an in-tree clang, then list clang as a dependency
|
|
|
|
# to run tests.
|
|
|
|
if (TARGET clang)
|
|
|
|
add_dependencies(check-lldb-lit clang)
|
|
|
|
endif()
|
|
|
|
|
2018-07-17 23:11:15 +08:00
|
|
|
add_lit_testsuites(LLDB
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
[LIT] First pass of LLDB LIT support
Summary:
This patch supplies basic infrastructure for LLDB to use LIT, and ports a few basic test cases from the LLDB test suite into LIT.
With this patch the LLDB lit system is not capable or intended to fully replace the existing LLDB test suite, but this first patch enables people to write lit tests for LLDB.
The lit substitution for %cc and %cxx default to the host compiler unless the CMake option LLDB_TEST_CLANG is On, in which case the in-tree clang will be used.
The target check-lldb-lit will run all lit tests including the lit-based executor for the unit tests. Alternatively there is a target generated for each subdirectory under the lit directory, so check-lldb-unit and check-lldb-expr will run just the tests under their respective directories.
The ported tests are not removed from the existing suite, and should not be until such a time when the lit runner is mature and in use by bots and workflows.
Reviewers: zturner, labath, jingham, tfiala
Subscribers: beanz, mgorny, lldb-commits
Differential Revision: https://reviews.llvm.org/D24591
llvm-svn: 281651
2016-09-16 04:13:55 +08:00
|
|
|
PARAMS lldb_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
|
|
|
|
lldb_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
|
|
|
|
DEPENDS ${LLDB_TEST_DEPS}
|
|
|
|
)
|