CFI: Add a check-cfi-and-supported rule.
authorPeter Collingbourne <peter@pcc.me.uk>
Wed, 25 Feb 2015 20:14:05 +0000 (20:14 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Wed, 25 Feb 2015 20:14:05 +0000 (20:14 +0000)
This rule works like check-cfi, but fails if the tests are unsupported.
This is useful to run on bots if we want to be sure that the tests aren't
silently being skipped.

llvm-svn: 230536

compiler-rt/test/cfi/CMakeLists.txt
compiler-rt/test/cfi/lit.cfg

index f519fb0..5750bd8 100644 (file)
@@ -20,4 +20,10 @@ endif()
 add_lit_testsuite(check-cfi "Running the cfi regression tests"
   ${CMAKE_CURRENT_BINARY_DIR}
   DEPENDS ${CFI_TEST_DEPS})
+
+add_lit_target(check-cfi-and-supported "Running the cfi regression tests"
+  ${CMAKE_CURRENT_BINARY_DIR}
+  PARAMS check_supported=1
+  DEPENDS ${CFI_TEST_DEPS})
+
 set_target_properties(check-cfi PROPERTIES FOLDER "Tests")
index d78820d..204d332 100644 (file)
@@ -33,3 +33,6 @@ elif sys.platform.startswith('linux') and is_linux_lto_supported():
   config.substitutions.append((r"%clangxx_cfi ", clangxx + ' -fuse-ld=gold -fsanitize=cfi '))
 else:
   config.unsupported = True
+
+if lit_config.params.get('check_supported', None) and config.unsupported:
+  raise BaseException("Tests unsupported")