mirror of
https://github.com/Kitware/CMake.git
synced 2026-07-01 04:07:15 +00:00
Tests/LinkStatic: Standardize RunCMake use where possible
Test cases which only check for the presence of an expression need not use a custom check script. Prepare for a future commit which adds more such cases so that this test consistently only uses check scripts where needed. Also apply more explicit checking for success or failure for each case.
This commit is contained in:
@@ -6,6 +6,9 @@ run_cmake(LINK_SEARCH_STATIC)
|
||||
macro(run_cmake_target test subtest target)
|
||||
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test}-build)
|
||||
set(RunCMake_TEST_NO_CLEAN 1)
|
||||
if(RunCMake_GENERATOR STREQUAL "Borland Makefiles")
|
||||
set(RunCMake_TEST_EXPECT_RESULT .)
|
||||
endif()
|
||||
run_cmake_command(${test}-${subtest} ${CMAKE_COMMAND} --build . --target ${target} ${ARGN})
|
||||
|
||||
unset(RunCMake_TEST_BINARY_DIR)
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
|
||||
if (NOT actual_stdout MATCHES "BADFLAG")
|
||||
set (RunCMake_TEST_FAILED "Not found expected 'BADFLAG'.")
|
||||
endif()
|
||||
@@ -1 +1 @@
|
||||
.*
|
||||
[^0]
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
.*BADFLAG.*
|
||||
@@ -1 +1 @@
|
||||
.*
|
||||
[^0]
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
|
||||
if (actual_stdout MATCHES "BADFLAG")
|
||||
string (APPEND RunCMake_TEST_FAILED "\nFound unexpected flag 'BADFLAG'.")
|
||||
endif()
|
||||
@@ -1 +0,0 @@
|
||||
.*
|
||||
Reference in New Issue
Block a user