mirror of
https://github.com/reactos/CMake.git
synced 2025-02-25 22:45:40 +00:00
Tests: Confirm test working dir set successfully
Specifically, this tests that setting WORKING_DIRECTORY to an invalid directory results in the test failing.
This commit is contained in:
parent
0e362b23e1
commit
a865f0beb2
@ -188,6 +188,7 @@ if (QT4_FOUND)
|
||||
endif()
|
||||
add_RunCMake_test(CompatibleInterface)
|
||||
add_RunCMake_test(Syntax)
|
||||
add_RunCMake_test(WorkingDirectory)
|
||||
|
||||
add_RunCMake_test(add_custom_command)
|
||||
add_RunCMake_test(add_custom_target)
|
||||
|
3
Tests/RunCMake/WorkingDirectory/CMakeLists.txt.in
Normal file
3
Tests/RunCMake/WorkingDirectory/CMakeLists.txt.in
Normal file
@ -0,0 +1,3 @@
|
||||
cmake_minimum_required(VERSION 3.11)
|
||||
project(@CASE_NAME@ NONE)
|
||||
include("@RunCMake_SOURCE_DIR@/@CASE_NAME@.cmake")
|
1
Tests/RunCMake/WorkingDirectory/CTestConfig.cmake.in
Normal file
1
Tests/RunCMake/WorkingDirectory/CTestConfig.cmake.in
Normal file
@ -0,0 +1 @@
|
||||
set(CTEST_PROJECT_NAME "CTestTestWorkingDir.@CASE_NAME@")
|
3
Tests/RunCMake/WorkingDirectory/RunCMakeTest.cmake
Normal file
3
Tests/RunCMake/WorkingDirectory/RunCMakeTest.cmake
Normal file
@ -0,0 +1,3 @@
|
||||
include(RunCTest)
|
||||
|
||||
run_ctest(dirNotExist)
|
1
Tests/RunCMake/WorkingDirectory/dirNotExist-result.txt
Normal file
1
Tests/RunCMake/WorkingDirectory/dirNotExist-result.txt
Normal file
@ -0,0 +1 @@
|
||||
(-1|255)
|
10
Tests/RunCMake/WorkingDirectory/dirNotExist-stdout.txt
Normal file
10
Tests/RunCMake/WorkingDirectory/dirNotExist-stdout.txt
Normal file
@ -0,0 +1,10 @@
|
||||
Test project .*/Tests/RunCMake/WorkingDirectory/dirNotExist-build
|
||||
.* +Start 1: dirNotExist
|
||||
1/1 Test #1: dirNotExist +\.+\*\*\*Not Run +[0-9.]+ sec
|
||||
+
|
||||
0% tests passed, 1 tests failed out of 1
|
||||
+
|
||||
Total Test time \(real\) = +[0-9.]+ sec
|
||||
+
|
||||
The following tests FAILED:
|
||||
.* +1 - dirNotExist \(Not Run\)$
|
6
Tests/RunCMake/WorkingDirectory/dirNotExist.cmake
Normal file
6
Tests/RunCMake/WorkingDirectory/dirNotExist.cmake
Normal file
@ -0,0 +1,6 @@
|
||||
include(CTest)
|
||||
|
||||
add_test(NAME dirNotExist
|
||||
COMMAND ${CMAKE_COMMAND} -E touch someFile.txt
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/thisDirWillNotExist
|
||||
)
|
15
Tests/RunCMake/WorkingDirectory/test.cmake.in
Normal file
15
Tests/RunCMake/WorkingDirectory/test.cmake.in
Normal file
@ -0,0 +1,15 @@
|
||||
cmake_minimum_required(VERSION 3.11)
|
||||
|
||||
set(CTEST_SITE "test-site")
|
||||
set(CTEST_BUILD_NAME "test-build-name")
|
||||
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@")
|
||||
set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
|
||||
|
||||
ctest_start(Experimental)
|
||||
ctest_configure()
|
||||
ctest_build()
|
||||
ctest_test()
|
Loading…
x
Reference in New Issue
Block a user