mirror of
https://github.com/reactos/CMake.git
synced 2024-11-24 12:09:48 +00:00
separgs: Migrate tests to RunCMake tests
This commit is contained in:
parent
41b84b2220
commit
81841426fc
@ -19,7 +19,6 @@ AddCMakeTest(GetFilenameComponentRealpath "")
|
||||
AddCMakeTest(Version "")
|
||||
AddCMakeTest(Message "")
|
||||
AddCMakeTest(File "")
|
||||
AddCMakeTest(SeparateArguments "")
|
||||
AddCMakeTest(ImplicitLinkInfo "")
|
||||
AddCMakeTest(ModuleNotices "")
|
||||
AddCMakeTest(GetProperty "")
|
||||
|
@ -1,25 +0,0 @@
|
||||
set(old_out "a b c")
|
||||
separate_arguments(old_out)
|
||||
set(old_exp "a;b;;c")
|
||||
|
||||
set(unix_cmd "a \"b c\" 'd e' \";\" \\ \\'\\\" '\\'' \"\\\"\"")
|
||||
set(unix_exp "a;b c;d e;\;; '\";';\"")
|
||||
separate_arguments(unix_out UNIX_COMMAND "${unix_cmd}")
|
||||
|
||||
set(windows_cmd "a \"b c\" 'd e' \";\" \\ \"c:\\windows\\path\\\\\" \\\"")
|
||||
set(windows_exp "a;b c;'d;e';\;;\\;c:\\windows\\path\\;\"")
|
||||
separate_arguments(windows_out WINDOWS_COMMAND "${windows_cmd}")
|
||||
|
||||
foreach(mode old unix windows)
|
||||
if(NOT "${${mode}_out}" STREQUAL "${${mode}_exp}")
|
||||
message(FATAL_ERROR "separate_arguments ${mode}-style failed. "
|
||||
"Expected\n [${${mode}_exp}]\nbut got\n [${${mode}_out}]\n")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
set(nothing)
|
||||
separate_arguments(nothing)
|
||||
if(DEFINED nothing)
|
||||
message(FATAL_ERROR "separate_arguments null-case failed: "
|
||||
"nothing=[${nothing}]")
|
||||
endif()
|
@ -216,6 +216,7 @@ add_RunCMake_test(list)
|
||||
add_RunCMake_test(message)
|
||||
add_RunCMake_test(project -DCMake_TEST_RESOURCES=${CMake_TEST_RESOURCES})
|
||||
add_RunCMake_test(return)
|
||||
add_RunCMake_test(separate_arguments)
|
||||
add_RunCMake_test(set_property)
|
||||
add_RunCMake_test(string)
|
||||
foreach(var
|
||||
|
3
Tests/RunCMake/separate_arguments/CMakeLists.txt
Normal file
3
Tests/RunCMake/separate_arguments/CMakeLists.txt
Normal file
@ -0,0 +1,3 @@
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
project(${RunCMake_TEST} NONE)
|
||||
include(${RunCMake_TEST}.cmake)
|
6
Tests/RunCMake/separate_arguments/EmptyCommand.cmake
Normal file
6
Tests/RunCMake/separate_arguments/EmptyCommand.cmake
Normal file
@ -0,0 +1,6 @@
|
||||
set(nothing)
|
||||
separate_arguments(nothing)
|
||||
if(DEFINED nothing)
|
||||
message(FATAL_ERROR "separate_arguments null-case failed: "
|
||||
"nothing=[${nothing}]")
|
||||
endif()
|
8
Tests/RunCMake/separate_arguments/PlainCommand.cmake
Normal file
8
Tests/RunCMake/separate_arguments/PlainCommand.cmake
Normal file
@ -0,0 +1,8 @@
|
||||
set(old_out "a b c")
|
||||
separate_arguments(old_out)
|
||||
set(old_exp "a;b;;c")
|
||||
|
||||
if(NOT "${old_out}" STREQUAL "${old_exp}")
|
||||
message(FATAL_ERROR "separate_arguments old-style failed. "
|
||||
"Expected\n [${old_exp}]\nbut got\n [${old_out}]\n")
|
||||
endif()
|
6
Tests/RunCMake/separate_arguments/RunCMakeTest.cmake
Normal file
6
Tests/RunCMake/separate_arguments/RunCMakeTest.cmake
Normal file
@ -0,0 +1,6 @@
|
||||
include(RunCMake)
|
||||
|
||||
run_cmake(EmptyCommand)
|
||||
run_cmake(PlainCommand)
|
||||
run_cmake(UnixCommand)
|
||||
run_cmake(WindowsCommand)
|
8
Tests/RunCMake/separate_arguments/UnixCommand.cmake
Normal file
8
Tests/RunCMake/separate_arguments/UnixCommand.cmake
Normal file
@ -0,0 +1,8 @@
|
||||
set(unix_cmd "a \"b c\" 'd e' \";\" \\ \\'\\\" '\\'' \"\\\"\"")
|
||||
set(unix_exp "a;b c;d e;\;; '\";';\"")
|
||||
separate_arguments(unix_out UNIX_COMMAND "${unix_cmd}")
|
||||
|
||||
if(NOT "${unix_out}" STREQUAL "${unix_exp}")
|
||||
message(FATAL_ERROR "separate_arguments unix-style failed. "
|
||||
"Expected\n [${unix_exp}]\nbut got\n [${unix_out}]\n")
|
||||
endif()
|
8
Tests/RunCMake/separate_arguments/WindowsCommand.cmake
Normal file
8
Tests/RunCMake/separate_arguments/WindowsCommand.cmake
Normal file
@ -0,0 +1,8 @@
|
||||
set(windows_cmd "a \"b c\" 'd e' \";\" \\ \"c:\\windows\\path\\\\\" \\\"")
|
||||
set(windows_exp "a;b c;'d;e';\;;\\;c:\\windows\\path\\;\"")
|
||||
separate_arguments(windows_out WINDOWS_COMMAND "${windows_cmd}")
|
||||
|
||||
if(NOT "${windows_out}" STREQUAL "${windows_exp}")
|
||||
message(FATAL_ERROR "separate_arguments windows-style failed. "
|
||||
"Expected\n [${windows_exp}]\nbut got\n [${windows_out}]\n")
|
||||
endif()
|
Loading…
Reference in New Issue
Block a user