diff options
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeLists.txt | 6 | ||||
-rw-r--r-- | Tests/FindLibUV/CMakeLists.txt | 10 | ||||
-rw-r--r-- | Tests/FindLibUV/Test/CMakeLists.txt | 17 | ||||
-rw-r--r-- | Tests/FindLibUV/Test/main.c | 7 | ||||
-rw-r--r-- | Tests/RunCMake/Make/CustomCommandDepfile-ERROR-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/Make/CustomCommandDepfile-ERROR-stderr.txt | 5 | ||||
-rw-r--r-- | Tests/RunCMake/Make/CustomCommandDepfile-ERROR.cmake | 8 | ||||
-rw-r--r-- | Tests/RunCMake/Make/RunCMakeTest.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/Ninja/CustomCommandDepfile-check.cmake | 5 | ||||
-rw-r--r-- | Tests/RunCMake/Ninja/CustomCommandDepfile.cmake | 11 | ||||
-rw-r--r-- | Tests/RunCMake/Ninja/RunCMakeTest.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/Syntax/CommandEOF-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/Syntax/CommandEOF-stderr.txt | 6 | ||||
-rw-r--r-- | Tests/RunCMake/Syntax/CommandEOF.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/Syntax/RunCMakeTest.cmake | 1 |
15 files changed, 81 insertions, 2 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 32e53d0..d6c96e1 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -676,8 +676,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release win64_release.cmake) ADD_NIGHTLY_BUILD_TEST(CMakeNightlyOSX osx_release.cmake) - ADD_NIGHTLY_BUILD_TEST(CMakeNightlyLinux32 - linux32_release.cmake) ADD_NIGHTLY_BUILD_TEST(CMakeNightlyLinux64 linux64_release.cmake) set_property(TEST CMakeNightlyWin64 PROPERTY DEPENDS CMakeNightlyWin32) @@ -1375,6 +1373,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release add_subdirectory(FindJsonCpp) endif() + if(CMake_TEST_FindLibUV) + add_subdirectory(FindLibUV) + endif() + if(CMake_TEST_FindLTTngUST) add_subdirectory(FindLTTngUST) endif() diff --git a/Tests/FindLibUV/CMakeLists.txt b/Tests/FindLibUV/CMakeLists.txt new file mode 100644 index 0000000..08aa958 --- /dev/null +++ b/Tests/FindLibUV/CMakeLists.txt @@ -0,0 +1,10 @@ +add_test(NAME FindLibUV.Test COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindLibUV/Test" + "${CMake_BINARY_DIR}/Tests/FindLibUV/Test" + ${build_generator_args} + --build-project TestFindLibUV + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) diff --git a/Tests/FindLibUV/Test/CMakeLists.txt b/Tests/FindLibUV/Test/CMakeLists.txt new file mode 100644 index 0000000..257ddf3 --- /dev/null +++ b/Tests/FindLibUV/Test/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.6) +project(TestFindLibUV C) +include(CTest) + +# CMake does not actually provide FindLibUV publicly. +set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../Source/Modules) + +find_package(LibUV REQUIRED) + +add_executable(test_libuv_tgt main.c) +target_link_libraries(test_libuv_tgt LibUV::LibUV) +add_test(NAME test_libuv_tgt COMMAND test_libuv_tgt) + +add_executable(test_libuv_var main.c) +target_include_directories(test_libuv_var PRIVATE ${LibUV_INCLUDE_DIRS}) +target_link_libraries(test_libuv_var PRIVATE ${LibUV_LIBRARIES}) +add_test(NAME test_libuv_var COMMAND test_libuv_var) diff --git a/Tests/FindLibUV/Test/main.c b/Tests/FindLibUV/Test/main.c new file mode 100644 index 0000000..cbd0db3 --- /dev/null +++ b/Tests/FindLibUV/Test/main.c @@ -0,0 +1,7 @@ +#include <uv.h> + +int main() +{ + uv_loop_close(uv_default_loop()); + return 0; +} diff --git a/Tests/RunCMake/Make/CustomCommandDepfile-ERROR-result.txt b/Tests/RunCMake/Make/CustomCommandDepfile-ERROR-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Make/CustomCommandDepfile-ERROR-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Make/CustomCommandDepfile-ERROR-stderr.txt b/Tests/RunCMake/Make/CustomCommandDepfile-ERROR-stderr.txt new file mode 100644 index 0000000..74d62a4 --- /dev/null +++ b/Tests/RunCMake/Make/CustomCommandDepfile-ERROR-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error at CustomCommandDepfile-ERROR.cmake:1 \(add_custom_command\): + add_custom_command Option DEPFILE not supported by [^ +]+ +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Make/CustomCommandDepfile-ERROR.cmake b/Tests/RunCMake/Make/CustomCommandDepfile-ERROR.cmake new file mode 100644 index 0000000..bad7955 --- /dev/null +++ b/Tests/RunCMake/Make/CustomCommandDepfile-ERROR.cmake @@ -0,0 +1,8 @@ +add_custom_command( + OUTPUT hello.copy.c + COMMAND "${CMAKE_COMMAND}" -E copy + "${CMAKE_CURRENT_SOURCE_DIR}/hello.c" + hello.copy.c + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" + DEPFILE "test.d" + ) diff --git a/Tests/RunCMake/Make/RunCMakeTest.cmake b/Tests/RunCMake/Make/RunCMakeTest.cmake index c6bbd03..869d11e 100644 --- a/Tests/RunCMake/Make/RunCMakeTest.cmake +++ b/Tests/RunCMake/Make/RunCMakeTest.cmake @@ -15,3 +15,5 @@ run_TargetMessages(OFF) run_TargetMessages(VAR-ON -DCMAKE_TARGET_MESSAGES=ON) run_TargetMessages(VAR-OFF -DCMAKE_TARGET_MESSAGES=OFF) + +run_cmake(CustomCommandDepfile-ERROR) diff --git a/Tests/RunCMake/Ninja/CustomCommandDepfile-check.cmake b/Tests/RunCMake/Ninja/CustomCommandDepfile-check.cmake new file mode 100644 index 0000000..189de64 --- /dev/null +++ b/Tests/RunCMake/Ninja/CustomCommandDepfile-check.cmake @@ -0,0 +1,5 @@ +set(log "${RunCMake_BINARY_DIR}/CustomCommandDepfile-build/build.ninja") +file(READ "${log}" build_file) +if(NOT "${build_file}" MATCHES "depfile = test\\.d") + set(RunCMake_TEST_FAILED "Log file:\n ${log}\ndoes not have expected line: depfile = test.d") +endif() diff --git a/Tests/RunCMake/Ninja/CustomCommandDepfile.cmake b/Tests/RunCMake/Ninja/CustomCommandDepfile.cmake new file mode 100644 index 0000000..dbef2a5 --- /dev/null +++ b/Tests/RunCMake/Ninja/CustomCommandDepfile.cmake @@ -0,0 +1,11 @@ +add_custom_command( + OUTPUT hello.copy.c + COMMAND "${CMAKE_COMMAND}" -E copy + "${CMAKE_CURRENT_SOURCE_DIR}/hello.c" + hello.copy.c + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" + DEPFILE "test.d" + ) +add_custom_target(copy ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/hello.copy.c") + +include(CheckNoPrefixSubDir.cmake) diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake b/Tests/RunCMake/Ninja/RunCMakeTest.cmake index 622c327..778f2c1 100644 --- a/Tests/RunCMake/Ninja/RunCMakeTest.cmake +++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake @@ -32,6 +32,8 @@ run_CMP0058(WARN-by) run_CMP0058(NEW-no) run_CMP0058(NEW-by) +run_cmake(CustomCommandDepfile) + function(run_SubDir) # Use a single build tree for a few tests without cleaning. set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/SubDir-build) diff --git a/Tests/RunCMake/Syntax/CommandEOF-result.txt b/Tests/RunCMake/Syntax/CommandEOF-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/CommandEOF-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/CommandEOF-stderr.txt b/Tests/RunCMake/Syntax/CommandEOF-stderr.txt new file mode 100644 index 0000000..31cbc08 --- /dev/null +++ b/Tests/RunCMake/Syntax/CommandEOF-stderr.txt @@ -0,0 +1,6 @@ +^CMake Error in CommandEOF.cmake: + Unexpected end of file. + + Parse error. Function missing opening "\(". +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/CommandEOF.cmake b/Tests/RunCMake/Syntax/CommandEOF.cmake new file mode 100644 index 0000000..36ebb02 --- /dev/null +++ b/Tests/RunCMake/Syntax/CommandEOF.cmake @@ -0,0 +1 @@ +message
\ No newline at end of file diff --git a/Tests/RunCMake/Syntax/RunCMakeTest.cmake b/Tests/RunCMake/Syntax/RunCMakeTest.cmake index fd012b9..d1fbb16 100644 --- a/Tests/RunCMake/Syntax/RunCMakeTest.cmake +++ b/Tests/RunCMake/Syntax/RunCMakeTest.cmake @@ -17,6 +17,7 @@ run_cmake(CommandSpaces) run_cmake(CommandTabs) run_cmake(CommandNewlines) run_cmake(CommandComments) +run_cmake(CommandEOF) run_cmake(CommandError0) run_cmake(CommandError1) run_cmake(CommandError2) |