Merge topic 'test-RunCMake-refactor-ctest'

e2b9e7f7 Tests: Drop unnecessary stderr matching from RunCMake.ctest_memcheck
7ce9f6e2 Tests: Teach RunCMake to tolerate 'Error kstat returned' lines in test output
69de0f7e Tests: Teach RunCMake to tolerate Guard Malloc lines in test output
57f2aa7c Tests: Teach RunCMake to tolerate BullseyeCoverage lines in test output
b04c8ec3 Tests: Match curl error in RunCMake.ctest_submit FailDrop-* cases
1d82105e Tests: Rename RunCMake.{CTestMemcheck => ctest_memcheck}
d7662141 Tests: Rename RunCMake.{CTestSubmit => ctest_submit}
9b50388b Tests: Split RunCTest helper out of RunCMake.CTest(Submit|Memcheck)
76e7c22b Tests: Rename RunCMake.CTestMemcheck internals to match CTestSubmit
This commit is contained in:
Brad King 2015-02-24 09:12:31 -05:00 committed by CMake Topic Stage
commit 8366b1bd4f
149 changed files with 104 additions and 120 deletions

View File

@ -64,10 +64,9 @@ add_RunCMake_test(CMP0053)
add_RunCMake_test(CMP0054)
add_RunCMake_test(CMP0055)
add_RunCMake_test(CTest)
add_RunCMake_test(CTestSubmit)
if(NOT CMake_TEST_EXTERNAL_CMAKE)
add_RunCMake_test(CTestMemcheck
add_RunCMake_test(ctest_memcheck
-DPSEUDO_BC=$<TARGET_FILE:pseudo_BC>
-DPSEUDO_PURIFY=$<TARGET_FILE:pseudo_purify>
-DPSEUDO_VALGRIND=$<TARGET_FILE:pseudo_valgrind>
@ -130,6 +129,7 @@ add_RunCMake_test(build_command)
add_RunCMake_test(export)
add_RunCMake_test(cmake_minimum_required)
add_RunCMake_test(continue)
add_RunCMake_test(ctest_submit)
add_RunCMake_test(file)
add_RunCMake_test(find_file)
add_RunCMake_test(find_library)

View File

@ -1,2 +0,0 @@
Cannot find memory tester output file: .*/Tests/RunCMake/CTestMemcheck/DummyAddressSanitizer-build/Testing/Temporary/MemoryChecker.1.log\.\*
Error in read script: .*/Tests/RunCMake/CTestMemcheck/DummyAddressSanitizer/test.cmake

View File

@ -1,3 +0,0 @@
Cannot find memory tester output file: .*/Tests/RunCMake/CTestMemcheck/DummyBCNoLogFile-build/Testing/Temporary/MemoryChecker.1.log
.*Error parsing XML in stream at line 1: no element found
Error in read script: .*/Tests/RunCMake/CTestMemcheck/DummyBCNoLogFile/test.cmake

View File

@ -1,2 +0,0 @@
Cannot find memory tester output file: .*/Tests/RunCMake/CTestMemcheck/DummyLeakSanitizer-build/Testing/Temporary/MemoryChecker.1.log\.\*
Error in read script: .*/Tests/RunCMake/CTestMemcheck/DummyLeakSanitizer/test.cmake

View File

@ -1,2 +0,0 @@
Cannot find memory tester output file: .*/Tests/RunCMake/CTestMemcheck/DummyMemorySanitizer-build/Testing/Temporary/MemoryChecker.1.log\.\*
Error in read script: .*/Tests/RunCMake/CTestMemcheck/DummyMemorySanitizer/test.cmake

View File

@ -1,3 +0,0 @@
^((^|
)(BullseyeCoverage|==|ctest\([0-9]+\) malloc:)[^
]*)*$

View File

@ -1,2 +0,0 @@
Cannot find memory tester output file: .*/Tests/RunCMake/CTestMemcheck/DummyPurifyNoLogFile-build/Testing/Temporary/MemoryChecker.1.log
Error in read script: .*/Tests/RunCMake/CTestMemcheck/DummyPurifyNoLogFile/test.cmake

View File

@ -1,2 +0,0 @@
Cannot find memory tester output file: .*/Tests/RunCMake/CTestMemcheck/DummyThreadSanitizer-build/Testing/Temporary/MemoryChecker.1.log\.\*
Error in read script: .*/Tests/RunCMake/CTestMemcheck/DummyThreadSanitizer/test.cmake

View File

@ -1,2 +0,0 @@
Cannot find memory tester output file: .*/Tests/RunCMake/CTestMemcheck/DummyUndefinedBehaviorSanitizer-build/Testing/Temporary/MemoryChecker.1.log\.\*
Error in read script: .*/Tests/RunCMake/CTestMemcheck/DummyUndefinedBehaviorSanitizer/test.cmake

View File

@ -1,3 +0,0 @@
^((^|
)(BullseyeCoverage|==|ctest\([0-9]+\) malloc:)[^
]*)*$

View File

@ -1,2 +0,0 @@
Cannot find memory tester output file: .*/Tests/RunCMake/CTestMemcheck/DummyValgrindCustomOptions-build/Testing/Temporary/MemoryChecker.1.log
Error in read script: .*/Tests/RunCMake/CTestMemcheck/DummyValgrindCustomOptions/test.cmake

View File

@ -1 +0,0 @@
Memory check project .*/Tests/RunCMake/CTestMemcheck/DummyValgrindFailPre-build

View File

@ -1,3 +0,0 @@
^((^|
)(BullseyeCoverage|==|ctest\([0-9]+\) malloc:)[^
]*)*$

View File

@ -1,2 +0,0 @@
Cannot find memory checker suppression file: .*/Tests/RunCMake/CTestMemcheck/DummyValgrindInvalidSupFile-build/does-not-exist
Error in read script: .*/Tests/RunCMake/CTestMemcheck/DummyValgrindInvalidSupFile/test.cmake

View File

@ -1 +0,0 @@
Memory check project .*/Tests/RunCMake/CTestMemcheck/DummyValgrindInvalidSupFile-build$

View File

@ -1,2 +0,0 @@
Cannot find memory tester output file: .*/Tests/RunCMake/CTestMemcheck/DummyValgrindNoLogFile-build/Testing/Temporary/MemoryChecker.1.log
Error in read script: .*/Tests/RunCMake/CTestMemcheck/DummyValgrindNoLogFile/test.cmake

View File

@ -1,3 +0,0 @@
^((^|
)(BullseyeCoverage|==|ctest\([0-9]+\) malloc:)[^
]*)*$

View File

@ -1,3 +0,0 @@
^((^|
)(BullseyeCoverage|==|ctest\([0-9]+\) malloc:)[^
]*)*$

View File

@ -1 +0,0 @@
Memory check project .*/Tests/RunCMake/CTestMemcheck/NotExist-build$

View File

@ -1,2 +0,0 @@
Do not understand memory checker: .*/cmake.*
Error in read script: .*/Tests/RunCMake/CTestMemcheck/Unknown/test.cmake

View File

@ -1 +0,0 @@
Memory check project .*/Tests/RunCMake/CTestMemcheck/Unknown-build$

View File

@ -1,2 +0,0 @@
CMake Error at .*/Tests/RunCMake/CTestSubmit/BadArg/test.cmake:[0-9]+ \(ctest_submit\):
ctest_submit called with unknown argument "bad-arg".

View File

@ -1,2 +0,0 @@
CMake Error at .*/Tests/RunCMake/CTestSubmit/BadFILES/test.cmake:[0-9]+ \(ctest_submit\):
File "bad-file" does not exist. Cannot submit a non-existent file.

View File

@ -1,2 +0,0 @@
CMake Error at .*/Tests/RunCMake/CTestSubmit/BadPARTS/test.cmake:[0-9]+ \(ctest_submit\):
Part name "bad-part" is invalid.

View File

@ -1,2 +0,0 @@
CMake Error at .*/Tests/RunCMake/CTestSubmit/CDashUploadFILES/test.cmake:[0-9]+ \(ctest_submit\):
ctest_submit called with unknown argument "FILES".

View File

@ -1,2 +0,0 @@
CMake Error at .*/Tests/RunCMake/CTestSubmit/CDashUploadPARTS/test.cmake:[0-9]+ \(ctest_submit\):
ctest_submit called with unknown argument "PARTS".

View File

@ -1,2 +0,0 @@
CMake Error at .*/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_COUNT/test.cmake:[0-9]+ \(ctest_submit\):
ctest_submit called with unknown argument "RETRY_COUNT".

View File

@ -1,2 +0,0 @@
CMake Error at .*/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_DELAY/test.cmake:[0-9]+ \(ctest_submit\):
ctest_submit called with unknown argument "RETRY_DELAY".

View File

@ -1,4 +0,0 @@
Missing arguments for submit via cp:
.*
Problems when submitting via CP
Error in read script: .*/Tests/RunCMake/CTestSubmit/FailDrop-cp/test.cmake

View File

@ -1,3 +0,0 @@
Error message was: .*
Problems when submitting via FTP
Error in read script: .*/Tests/RunCMake/CTestSubmit/FailDrop-ftp/test.cmake

View File

@ -1,3 +0,0 @@
Error message was: .*
Problems when submitting via HTTP
Error in read script: .*/Tests/RunCMake/CTestSubmit/FailDrop-http/test.cmake

View File

@ -1,3 +0,0 @@
Error message was: .*
Problems when submitting via HTTP
Error in read script: .*/Tests/RunCMake/CTestSubmit/FailDrop-https/test.cmake

View File

@ -1,2 +0,0 @@
Problems when submitting via SCP
Error in read script: .*/Tests/RunCMake/CTestSubmit/FailDrop-scp/test.cmake

View File

@ -1,2 +0,0 @@
CMake Error at .*/Tests/RunCMake/CTestSubmit/PARTSCDashUpload/test.cmake:[0-9]+ \(ctest_submit\):
Part name "CDASH_UPLOAD" is invalid.

View File

@ -1,2 +0,0 @@
CMake Error at .*/Tests/RunCMake/CTestSubmit/PARTSCDashUploadType/test.cmake:[0-9]+ \(ctest_submit\):
Part name "CDASH_UPLOAD_TYPE" is invalid.

View File

@ -1,2 +0,0 @@
CMake Error at .*/Tests/RunCMake/CTestSubmit/RepeatRETURN_VALUE/test.cmake:[0-9]+ \(ctest_submit\):
Called with more than one value for RETURN_VALUE

View File

@ -22,6 +22,16 @@ but do not actually build anything. To add a test:
to fully customize the test case command-line.
Alternatively, if the test is to cover running ``ctest -S`` then use::
include(RunCTest)
run_ctest(SubTest1)
...
run_ctest(SubTestN)
and create ``test.cmake.in``, ``CTestConfig.cmake.in``, and
``CMakeLists.txt.in`` files to be configured for each case.
4. Create file ``<Test>/CMakeLists.txt`` in the directory containing::
cmake_minimum_required(...)

View File

@ -83,7 +83,7 @@ function(run_cmake test)
endif()
foreach(o out err)
string(REGEX REPLACE "\r\n" "\n" actual_std${o} "${actual_std${o}}")
string(REGEX REPLACE "(^|\n)(==[0-9]+==[^\n]*\n)+" "\\1" actual_std${o} "${actual_std${o}}")
string(REGEX REPLACE "(^|\n)((==[0-9]+==|BullseyeCoverage|[a-z]+\\([0-9]+\\) malloc:|Error kstat returned)[^\n]*\n)+" "\\1" actual_std${o} "${actual_std${o}}")
string(REGEX REPLACE "\n+$" "" actual_std${o} "${actual_std${o}}")
set(expect_${o} "")
if(DEFINED expect_std${o})

View File

@ -0,0 +1,17 @@
include(RunCMake)
function(run_ctest CASE_NAME)
configure_file(${RunCMake_SOURCE_DIR}/test.cmake.in
${RunCMake_BINARY_DIR}/${CASE_NAME}/test.cmake @ONLY)
configure_file(${RunCMake_SOURCE_DIR}/CTestConfig.cmake.in
${RunCMake_BINARY_DIR}/${CASE_NAME}/CTestConfig.cmake @ONLY)
configure_file(${RunCMake_SOURCE_DIR}/CMakeLists.txt.in
${RunCMake_BINARY_DIR}/${CASE_NAME}/CMakeLists.txt @ONLY)
run_cmake_command(${CASE_NAME} ${CMAKE_CTEST_COMMAND}
-C Debug
-S ${RunCMake_BINARY_DIR}/${CASE_NAME}/test.cmake
-V
--output-log ${RunCMake_BINARY_DIR}/${CASE_NAME}-build/testOutput.log
${ARGN}
)
endfunction()

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 2.8.9)
project(CTestTestMemcheck@SUBTEST_NAME@ NONE)
project(CTestTestMemcheck@CASE_NAME@ NONE)
include(CTest)
add_test(NAME RunCMake COMMAND "${CMAKE_COMMAND}" --version)

View File

@ -1,4 +1,4 @@
set (CTEST_PROJECT_NAME "CTestTestMemcheck@SUBTEST_NAME@")
set (CTEST_PROJECT_NAME "CTestTestMemcheck@CASE_NAME@")
set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
set (CTEST_DART_SERVER_VERSION "2")
set(CTEST_DROP_METHOD "http")

View File

@ -0,0 +1,2 @@
Cannot find memory tester output file: .*/Tests/RunCMake/ctest_memcheck/DummyAddressSanitizer-build/Testing/Temporary/MemoryChecker.1.log\.\*
Error in read script: .*/Tests/RunCMake/ctest_memcheck/DummyAddressSanitizer/test.cmake

View File

@ -0,0 +1,3 @@
Cannot find memory tester output file: .*/Tests/RunCMake/ctest_memcheck/DummyBCNoLogFile-build/Testing/Temporary/MemoryChecker.1.log
.*Error parsing XML in stream at line 1: no element found
Error in read script: .*/Tests/RunCMake/ctest_memcheck/DummyBCNoLogFile/test.cmake

View File

@ -0,0 +1,2 @@
Cannot find memory tester output file: .*/Tests/RunCMake/ctest_memcheck/DummyLeakSanitizer-build/Testing/Temporary/MemoryChecker.1.log\.\*
Error in read script: .*/Tests/RunCMake/ctest_memcheck/DummyLeakSanitizer/test.cmake

View File

@ -0,0 +1,2 @@
Cannot find memory tester output file: .*/Tests/RunCMake/ctest_memcheck/DummyMemorySanitizer-build/Testing/Temporary/MemoryChecker.1.log\.\*
Error in read script: .*/Tests/RunCMake/ctest_memcheck/DummyMemorySanitizer/test.cmake

View File

@ -0,0 +1,2 @@
Cannot find memory tester output file: .*/Tests/RunCMake/ctest_memcheck/DummyPurifyNoLogFile-build/Testing/Temporary/MemoryChecker.1.log
Error in read script: .*/Tests/RunCMake/ctest_memcheck/DummyPurifyNoLogFile/test.cmake

View File

@ -0,0 +1,2 @@
Cannot find memory tester output file: .*/Tests/RunCMake/ctest_memcheck/DummyThreadSanitizer-build/Testing/Temporary/MemoryChecker.1.log\.\*
Error in read script: .*/Tests/RunCMake/ctest_memcheck/DummyThreadSanitizer/test.cmake

View File

@ -0,0 +1,2 @@
Cannot find memory tester output file: .*/Tests/RunCMake/ctest_memcheck/DummyUndefinedBehaviorSanitizer-build/Testing/Temporary/MemoryChecker.1.log\.\*
Error in read script: .*/Tests/RunCMake/ctest_memcheck/DummyUndefinedBehaviorSanitizer/test.cmake

View File

@ -0,0 +1,2 @@
Cannot find memory tester output file: .*/Tests/RunCMake/ctest_memcheck/DummyValgrindCustomOptions-build/Testing/Temporary/MemoryChecker.1.log
Error in read script: .*/Tests/RunCMake/ctest_memcheck/DummyValgrindCustomOptions/test.cmake

View File

@ -1,3 +1,3 @@
Problem running command: .*memcheck_fail.*
Problem executing post-memcheck command\(s\).
Error in read script: .*/Tests/RunCMake/CTestMemcheck/DummyValgrindFailPost/test.cmake
Error in read script: .*/Tests/RunCMake/ctest_memcheck/DummyValgrindFailPost/test.cmake

View File

@ -1,3 +1,3 @@
Problem running command: .*memcheck_fail.*
Problem executing pre-memcheck command\(s\).
Error in read script: .*/Tests/RunCMake/CTestMemcheck/DummyValgrindFailPre/test.cmake
Error in read script: .*/Tests/RunCMake/ctest_memcheck/DummyValgrindFailPre/test.cmake

View File

@ -0,0 +1 @@
Memory check project .*/Tests/RunCMake/ctest_memcheck/DummyValgrindFailPre-build

View File

@ -0,0 +1,2 @@
Cannot find memory checker suppression file: .*/Tests/RunCMake/ctest_memcheck/DummyValgrindInvalidSupFile-build/does-not-exist
Error in read script: .*/Tests/RunCMake/ctest_memcheck/DummyValgrindInvalidSupFile/test.cmake

View File

@ -0,0 +1 @@
Memory check project .*/Tests/RunCMake/ctest_memcheck/DummyValgrindInvalidSupFile-build$

View File

@ -0,0 +1,2 @@
Cannot find memory tester output file: .*/Tests/RunCMake/ctest_memcheck/DummyValgrindNoLogFile-build/Testing/Temporary/MemoryChecker.1.log
Error in read script: .*/Tests/RunCMake/ctest_memcheck/DummyValgrindNoLogFile/test.cmake

View File

@ -0,0 +1 @@
Memory check project .*/Tests/RunCMake/ctest_memcheck/NotExist-build$

View File

@ -1,23 +1,11 @@
include(RunCMake)
include(RunCTest)
set(SITE test-site)
set(BUILDNAME test-build)
set(COVERAGE_COMMAND "")
function(run_mc_test SUBTEST_NAME CHECKER_COMMAND)
configure_file(${RunCMake_SOURCE_DIR}/test.cmake.in
${RunCMake_BINARY_DIR}/${SUBTEST_NAME}/test.cmake @ONLY)
configure_file(${RunCMake_SOURCE_DIR}/CTestConfig.cmake.in
${RunCMake_BINARY_DIR}/${SUBTEST_NAME}/CTestConfig.cmake @ONLY)
configure_file(${RunCMake_SOURCE_DIR}/CMakeLists.txt.in
${RunCMake_BINARY_DIR}/${SUBTEST_NAME}/CMakeLists.txt @ONLY)
run_cmake_command(${SUBTEST_NAME} ${CMAKE_CTEST_COMMAND}
-C Debug
-S ${RunCMake_BINARY_DIR}/${SUBTEST_NAME}/test.cmake
-V
--output-log ${RunCMake_BINARY_DIR}/${SUBTEST_NAME}-build/testOutput.log
${ARGN}
)
function(run_mc_test CASE_NAME CHECKER_COMMAND)
run_ctest(${CASE_NAME} ${ARGN})
endfunction()
unset(CTEST_EXTRA_CONFIG)

View File

@ -0,0 +1,2 @@
Do not understand memory checker: .*/cmake.*
Error in read script: .*/Tests/RunCMake/ctest_memcheck/Unknown/test.cmake

View File

@ -0,0 +1 @@
Memory check project .*/Tests/RunCMake/ctest_memcheck/Unknown-build$

View File

@ -2,10 +2,10 @@ cmake_minimum_required(VERSION 2.8.9)
# Settings:
set(CTEST_SITE "@SITE@")
set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Memcheck@SUBTEST_NAME@")
set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Memcheck@CASE_NAME@")
set(CTEST_SOURCE_DIRECTORY "@RunCMake_BINARY_DIR@/@SUBTEST_NAME@")
set(CTEST_BINARY_DIRECTORY "@RunCMake_BINARY_DIR@/@SUBTEST_NAME@-build")
set(CTEST_SOURCE_DIRECTORY "@RunCMake_BINARY_DIR@/@CASE_NAME@")
set(CTEST_BINARY_DIRECTORY "@RunCMake_BINARY_DIR@/@CASE_NAME@-build")
set(CTEST_CMAKE_GENERATOR "@RunCMake_GENERATOR@")
set(CTEST_CMAKE_GENERATOR_PLATFORM "@RunCMake_GENERATOR_PLATFORM@")
set(CTEST_CMAKE_GENERATOR_TOOLSET "@RunCMake_GENERATOR_TOOLSET@")

Some files were not shown because too many files have changed in this diff Show More