[PATCH] D34053: [Polly][CMake] Skip unit-tests in lit if gtest is not available
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 11 04:38:10 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL307651: [Polly][CMake] Skip unit-tests in lit if gtest is not available (authored by pfaffe).
Changed prior to commit:
https://reviews.llvm.org/D34053?vs=102017&id=106002#toc
Repository:
rL LLVM
https://reviews.llvm.org/D34053
Files:
polly/trunk/CMakeLists.txt
polly/trunk/test/CMakeLists.txt
polly/trunk/test/Unit/lit.cfg
polly/trunk/test/Unit/lit.site.cfg.in
Index: polly/trunk/test/Unit/lit.cfg
===================================================================
--- polly/trunk/test/Unit/lit.cfg
+++ polly/trunk/test/Unit/lit.cfg
@@ -11,6 +11,9 @@
# name: The name of this test suite.
config.name = 'Polly-Unit'
+if not config.has_unittests:
+ raise SystemExit
+
# suffixes: A list of file extensions to treat as test files.
config.suffixes = []
Index: polly/trunk/test/Unit/lit.site.cfg.in
===================================================================
--- polly/trunk/test/Unit/lit.site.cfg.in
+++ polly/trunk/test/Unit/lit.site.cfg.in
@@ -14,6 +14,7 @@
config.target_triple = "@TARGET_TRIPLE@"
config.enable_gpgpu_codegen = "@GPU_CODEGEN@"
config.link_polly_into_tools = "@LINK_POLLY_INTO_TOOLS@"
+config.has_unittests = @POLLY_GTEST_AVAIL@
# Support substitution of the tools_dir, libs_dirs, and build_mode with user
# parameters. This is used when we can't determine the tool dir at
Index: polly/trunk/test/CMakeLists.txt
===================================================================
--- polly/trunk/test/CMakeLists.txt
+++ polly/trunk/test/CMakeLists.txt
@@ -62,12 +62,12 @@
set_target_properties(check-polly-tests PROPERTIES FOLDER "Polly")
add_dependencies(check-polly check-polly-tests)
-if (POLLY_GTEST_AVAIL)
- configure_lit_site_cfg(
- ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in
- ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
- )
+configure_lit_site_cfg(
+ ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in
+ ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
+ )
+if (POLLY_GTEST_AVAIL)
# Run only unit tests
add_lit_testsuite(check-polly-unittests "Running polly unit tests only"
${CMAKE_CURRENT_BINARY_DIR}/Unit
Index: polly/trunk/CMakeLists.txt
===================================================================
--- polly/trunk/CMakeLists.txt
+++ polly/trunk/CMakeLists.txt
@@ -24,6 +24,7 @@
endif()
# Enable unit tests if available.
+ set(POLLY_GTEST_AVAIL 0)
set(UNITTEST_DIR ${LLVM_SOURCE_ROOT}/utils/unittest)
if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h)
# The build tree already exports the gtest target, which we can reuse
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34053.106002.patch
Type: text/x-patch
Size: 2184 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170711/26d81d41/attachment.bin>
More information about the llvm-commits
mailing list