diff options
author | Zachary Turner <zturner@google.com> | 2017-11-20 21:41:36 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2017-11-20 21:41:36 +0000 |
commit | 8b6ef88e7eb618dea0160eaddecf901eb28bc2e1 (patch) | |
tree | bd11371e1f6546d50915f368950551b7a024bff5 /debuginfo-tests/CMakeLists.txt | |
parent | 5c774b9235d5d898171c48ed71912d7761aa491e (diff) | |
download | bcm5719-llvm-8b6ef88e7eb618dea0160eaddecf901eb28bc2e1.tar.gz bcm5719-llvm-8b6ef88e7eb618dea0160eaddecf901eb28bc2e1.zip |
Resubmit "Refactor debuginfo-tests" again.
This was reverted due to the tests being run twice on some
build bots. Each run had a slightly different configuration
due to the way in which it was being invoked. This fixes
the problem (albeit in a somewhat hacky way). Hopefully in
the future we can get rid of the workflow of running
debuginfo-tests as part of clang, and then this hack can
go away.
llvm-svn: 318697
Diffstat (limited to 'debuginfo-tests/CMakeLists.txt')
-rw-r--r-- | debuginfo-tests/CMakeLists.txt | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/debuginfo-tests/CMakeLists.txt b/debuginfo-tests/CMakeLists.txt new file mode 100644 index 00000000000..5c4b1701243 --- /dev/null +++ b/debuginfo-tests/CMakeLists.txt @@ -0,0 +1,46 @@ +# Debug Info tests. These tests invoke clang to generate programs with +# various types of debug info, and then run those programs under a debugger +# such as GDB or LLDB to verify the results. + +if (DEBUGINFO_TESTS_EXCLUDE_FROM_ALL) + # When run from inside of the clang tree, lit will pick up two different + # test suites. It will pick up debuginfo-tests as a standalone test + # suite since it has a lit.cfg, but it will also run because it will + # be identified as a subsuite of clang during discovery. We rely on + # clang to set this so that this configuration only gets picked up + # once. + set(EXCLUDE_FROM_ALL ON) +endif() + +set(DEBUGINFO_TESTS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) +set(DEBUGINFO_TESTS_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) + +set(DEBUGINFO_TEST_DEPS + clang + llvm-config + FileCheck + count + not + ) + +get_target_property(CLANG_SOURCE_DIR clang SOURCE_DIR) + +if (TARGET lld) + set(DEBUGINFO_TESTS_HAS_LLD 1) + list(APPEND DEBUGINFO_TEST_DEPS lld) + get_target_property(LLD_SOURCE_DIR lld SOURCE_DIR) +endif() + +configure_lit_site_cfg( + ${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 + ) + +add_lit_testsuite(check-debuginfo "Running debug info integration tests" + ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS ${DEBUGINFO_TEST_DEPS} + ) + +set_target_properties(check-debuginfo PROPERTIES FOLDER "Debug info tests")
\ No newline at end of file |