diff options
Diffstat (limited to 'Tests')
120 files changed, 929 insertions, 11 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index aad7cfc..38b4828 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1359,6 +1359,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release add_subdirectory(FindICU) endif() + if(CMake_TEST_FindJPEG) + add_subdirectory(FindJPEG) + endif() + if(CMake_TEST_FindJsonCpp) add_subdirectory(FindJsonCpp) endif() diff --git a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt index 443d366..a53e441 100644 --- a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt +++ b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt @@ -86,7 +86,7 @@ foreach(VTEST ALSA ARMADILLO BZIP2 CUPS CURL EXPAT FREETYPE GETTEXT GIT HG endforeach() foreach(VTEST BISON Boost CUDA DOXYGEN FLEX GIF GTK2 - HDF5 LibArchive OPENSCENEGRAPH RUBY SWIG Protobuf) + HDF5 JPEG LibArchive OPENSCENEGRAPH RUBY SWIG Protobuf) check_version_string(${VTEST} ${VTEST}_VERSION) endforeach() diff --git a/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in b/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in index 65487bb..9157c76 100644 --- a/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in +++ b/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in @@ -349,6 +349,12 @@ set(aix_xlf90_64_libs "xlf90;xlopt;xlf;xlomp_ser;m;c") set(aix_xlf90_64_dirs "/usr/lpp/xlf/lib") list(APPEND platforms aix_xlf90_64) +# g++ dummy.c -v +set(aix_g++_text " /prefix/libexec/gcc/powerpc-ibm-aix7.2.0.0/7.2.0/collect2 -bpT:0x10000000 -bpD:0x20000000 -btextro /lib/crt0.o /prefix/lib/gcc/powerpc-ibm-aix7.2.0.0/7.2.0/crtcxa.o /prefix/lib/gcc/powerpc-ibm-aix7.2.0.0/7.2.0/crtdbase.o -L/prefix/lib/gcc/powerpc-ibm-aix7.2.0.0/7.2.0 -L/prefix/lib/gcc/powerpc-ibm-aix7.2.0.0/7.2.0/../../.. /tmp//ccKROJ1f.o -lstdc++ -lm -lgcc_s /prefix/lib/gcc/powerpc-ibm-aix7.2.0.0/7.2.0/libgcc.a -lc -lgcc_s /prefix/lib/gcc/powerpc-ibm-aix7.2.0.0/7.2.0/libgcc.a") +set(aix_g++_libs "stdc++;m;gcc_s;/prefix/lib/gcc/powerpc-ibm-aix7.2.0.0/7.2.0/libgcc.a;c;gcc_s;/prefix/lib/gcc/powerpc-ibm-aix7.2.0.0/7.2.0/libgcc.a") +set(aix_g++_dirs "/prefix/lib/gcc/powerpc-ibm-aix7.2.0.0/7.2.0;/prefix/lib") +list(APPEND platforms aix_g++) + #----------------------------------------------------------------------------- # HP diff --git a/Tests/CudaOnly/CMakeLists.txt b/Tests/CudaOnly/CMakeLists.txt index 565baca..59f3e84 100644 --- a/Tests/CudaOnly/CMakeLists.txt +++ b/Tests/CudaOnly/CMakeLists.txt @@ -6,3 +6,7 @@ ADD_TEST_MACRO(CudaOnly.LinkSystemDeviceLibraries CudaOnlyLinkSystemDeviceLibrar ADD_TEST_MACRO(CudaOnly.ResolveDeviceSymbols CudaOnlyResolveDeviceSymbols) ADD_TEST_MACRO(CudaOnly.SeparateCompilation CudaOnlySeparateCompilation) ADD_TEST_MACRO(CudaOnly.WithDefs CudaOnlyWithDefs) + +if(MSVC) + ADD_TEST_MACRO(CudaOnly.PDB CudaOnlyPDB) +endif() diff --git a/Tests/CudaOnly/PDB/CMakeLists.txt b/Tests/CudaOnly/PDB/CMakeLists.txt new file mode 100644 index 0000000..34e1e5c --- /dev/null +++ b/Tests/CudaOnly/PDB/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.11) +project (CudaOnlyPDB CUDA) + +add_executable(CudaOnlyPDB main.cu) +set_target_properties(CudaOnlyPDB PROPERTIES + PDB_NAME LinkPDBName + PDB_OUTPUT_DIRECTORY LinkPDBDir + COMPILE_PDB_NAME CompPDBName + COMPILE_PDB_OUTPUT_DIRECTORY CompPDBDir + ) + +set(pdbs + ${CMAKE_CURRENT_BINARY_DIR}/CompPDBDir/${CMAKE_CFG_INTDIR}/CompPDBName.pdb + ${CMAKE_CURRENT_BINARY_DIR}/LinkPDBDir/${CMAKE_CFG_INTDIR}/LinkPDBName.pdb + ) +add_custom_command(TARGET CudaOnlyPDB POST_BUILD + COMMAND ${CMAKE_COMMAND} -Dconfig=$<CONFIG> "-Dpdbs=${pdbs}" + -P ${CMAKE_CURRENT_SOURCE_DIR}/check_pdbs.cmake + ) diff --git a/Tests/CudaOnly/PDB/check_pdbs.cmake b/Tests/CudaOnly/PDB/check_pdbs.cmake new file mode 100644 index 0000000..5e01ca7 --- /dev/null +++ b/Tests/CudaOnly/PDB/check_pdbs.cmake @@ -0,0 +1,10 @@ +if(NOT "${config}" MATCHES "[Dd][Ee][Bb]") + return() +endif() +foreach(pdb ${pdbs}) + if(EXISTS "${pdb}") + message(STATUS "PDB Exists: ${pdb}") + else() + message(SEND_ERROR "PDB MISSING:\n ${pdb}") + endif() +endforeach() diff --git a/Tests/CudaOnly/PDB/main.cu b/Tests/CudaOnly/PDB/main.cu new file mode 100644 index 0000000..f8b643a --- /dev/null +++ b/Tests/CudaOnly/PDB/main.cu @@ -0,0 +1,4 @@ +int main() +{ + return 0; +} diff --git a/Tests/FindJPEG/CMakeLists.txt b/Tests/FindJPEG/CMakeLists.txt new file mode 100644 index 0000000..c8663c5 --- /dev/null +++ b/Tests/FindJPEG/CMakeLists.txt @@ -0,0 +1,10 @@ +add_test(NAME FindJPEG.Test COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindJPEG/Test" + "${CMake_BINARY_DIR}/Tests/FindJPEG/Test" + ${build_generator_args} + --build-project TestFindJPEG + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) diff --git a/Tests/FindJPEG/Test/CMakeLists.txt b/Tests/FindJPEG/Test/CMakeLists.txt new file mode 100644 index 0000000..a744f85 --- /dev/null +++ b/Tests/FindJPEG/Test/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.1) +project(TestFindJPEG C) +include(CTest) + +find_package(JPEG) + +add_executable(test_jpeg_tgt main.c) +target_link_libraries(test_jpeg_tgt JPEG::JPEG) +add_test(NAME test_jpeg_tgt COMMAND test_jpeg_tgt) + +add_executable(test_jpeg_var main.c) +target_include_directories(test_jpeg_var PRIVATE ${JPEG_INCLUDE_DIRS}) +target_link_libraries(test_jpeg_var PRIVATE ${JPEG_LIBRARIES}) +add_test(NAME test_jpeg_var COMMAND test_jpeg_var) diff --git a/Tests/FindJPEG/Test/main.c b/Tests/FindJPEG/Test/main.c new file mode 100644 index 0000000..c6e48f0 --- /dev/null +++ b/Tests/FindJPEG/Test/main.c @@ -0,0 +1,16 @@ +#include <assert.h> +#include <stdio.h> + +#include <jpeglib.h> + +int main() +{ + /* Without any JPEG file to open, test that the call fails as + expected. This tests that linking worked. */ + struct jpeg_decompress_struct cinfo; + struct jpeg_error_mgr jerr; + cinfo.err = jpeg_std_error(&jerr); + jpeg_create_decompress(&cinfo); + + return 0; +} diff --git a/Tests/Module/ExternalData/Data5/CMakeLists.txt b/Tests/Module/ExternalData/Data5/CMakeLists.txt index 13c7fab..ea67f05 100644 --- a/Tests/Module/ExternalData/Data5/CMakeLists.txt +++ b/Tests/Module/ExternalData/Data5/CMakeLists.txt @@ -2,21 +2,21 @@ ExternalData_Add_Test(Data5.A NAME Data5Check.A COMMAND ${CMAKE_COMMAND} - -D Data5=DATA{../Data.dat} + -D Data5=DATA{Data5.dat} -P ${CMAKE_CURRENT_SOURCE_DIR}/Data5Check.cmake ) ExternalData_Add_Target(Data5.A) ExternalData_Add_Test(Data5.B NAME Data5Check.B COMMAND ${CMAKE_COMMAND} - -D Data5=DATA{../Data.dat} + -D Data5=DATA{Data5.dat} -P ${CMAKE_CURRENT_SOURCE_DIR}/Data5Check.cmake ) ExternalData_Add_Target(Data5.B) ExternalData_Add_Test(Data5.C NAME Data5Check.C COMMAND ${CMAKE_COMMAND} - -D Data5=DATA{../Data.dat} + -D Data5=DATA{Data5.dat} -P ${CMAKE_CURRENT_SOURCE_DIR}/Data5Check.cmake ) ExternalData_Add_Target(Data5.C) diff --git a/Tests/Module/ExternalData/Data5/Data5.dat.md5 b/Tests/Module/ExternalData/Data5/Data5.dat.md5 new file mode 100644 index 0000000..70e39bd --- /dev/null +++ b/Tests/Module/ExternalData/Data5/Data5.dat.md5 @@ -0,0 +1 @@ +8c018830e3efa5caf3c7415028335a57 diff --git a/Tests/PolicyScope/CMakeLists.txt b/Tests/PolicyScope/CMakeLists.txt index 413195a..353842b 100644 --- a/Tests/PolicyScope/CMakeLists.txt +++ b/Tests/PolicyScope/CMakeLists.txt @@ -52,6 +52,10 @@ if(1) # CMP0002 should be changed when this function is invoked cmake_policy(GET CMP0002 cmp) check(CMP0002 "OLD" "${cmp}") + + # The undocumented PARENT_SCOPE option sees the caller's setting. + cmake_policy(GET CMP0002 cmp PARENT_SCOPE) + check(CMP0002 "NEW" "${cmp}") endfunction() # Unset CMP0002 @@ -61,6 +65,10 @@ if(1) cmake_policy(GET CMP0002 cmp) check(CMP0002 "" "${cmp}") + # The undocumented PARENT_SCOPE option sees the caller's setting. + cmake_policy(GET CMP0002 cmp PARENT_SCOPE) + check(CMP0002 "NEW" "${cmp}") + # Setting the policy should work here and also in the caller. cmake_policy(SET CMP0002 OLD) cmake_policy(GET CMP0002 cmp) diff --git a/Tests/RunCMake/Android/RunCMakeTest.cmake b/Tests/RunCMake/Android/RunCMakeTest.cmake index 86a9896..2027c4f 100644 --- a/Tests/RunCMake/Android/RunCMakeTest.cmake +++ b/Tests/RunCMake/Android/RunCMakeTest.cmake @@ -88,12 +88,14 @@ foreach(ndk IN LISTS TEST_ANDROID_NDK) -DCMAKE_ANDROID_ARM_MODE=0 ) run_cmake(ndk-badarm) - set(RunCMake_TEST_OPTIONS - -DCMAKE_SYSTEM_NAME=Android - -DCMAKE_ANDROID_NDK=${ndk} - -DCMAKE_ANDROID_ARM_NEON=0 - ) - run_cmake(ndk-badneon) + if("armeabi" IN_LIST _abis_) + set(RunCMake_TEST_OPTIONS + -DCMAKE_SYSTEM_NAME=Android + -DCMAKE_ANDROID_NDK=${ndk} + -DCMAKE_ANDROID_ARM_NEON=0 + ) + run_cmake(ndk-badneon) + endif() set(RunCMake_TEST_OPTIONS -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_NDK=${ndk} diff --git a/Tests/RunCMake/Android/ndk-badvernum-stderr.txt b/Tests/RunCMake/Android/ndk-badvernum-stderr.txt index 25bbaf9..adacaf1 100644 --- a/Tests/RunCMake/Android/ndk-badvernum-stderr.txt +++ b/Tests/RunCMake/Android/ndk-badvernum-stderr.txt @@ -1,5 +1,5 @@ ^CMake Error at .*/Modules/Platform/Android/Determine-Compiler-NDK.cmake:[0-9]+ \(message\): - Android: No toolchain for ABI 'armeabi' found in the NDK: + Android: No toolchain for ABI 'armeabi(-v7a)?' found in the NDK: .* diff --git a/Tests/RunCMake/CheckModules/CMP0075-stderr.txt b/Tests/RunCMake/CheckModules/CMP0075-stderr.txt new file mode 100644 index 0000000..960fe94 --- /dev/null +++ b/Tests/RunCMake/CheckModules/CMP0075-stderr.txt @@ -0,0 +1,50 @@ +^CMake Warning \(dev\) at [^ +]*/Modules/CheckIncludeFile.cmake:[0-9]+ \(message\): + Policy CMP0075 is not set: Include file check macros honor + CMAKE_REQUIRED_LIBRARIES. Run "cmake --help-policy CMP0075" for policy + details. Use the cmake_policy command to set the policy and suppress this + warning. + + CMAKE_REQUIRED_LIBRARIES is set to: + + does_not_exist + + For compatibility with CMake 3.11 and below this check is ignoring it. +Call Stack \(most recent call first\): + CMP0075.cmake:11 \(check_include_file\) + CMakeLists.txt:[0-9]+ \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. ++ +CMake Warning \(dev\) at [^ +]*/Modules/CheckIncludeFileCXX.cmake:[0-9]+ \(message\): + Policy CMP0075 is not set: Include file check macros honor + CMAKE_REQUIRED_LIBRARIES. Run "cmake --help-policy CMP0075" for policy + details. Use the cmake_policy command to set the policy and suppress this + warning. + + CMAKE_REQUIRED_LIBRARIES is set to: + + does_not_exist + + For compatibility with CMake 3.11 and below this check is ignoring it. +Call Stack \(most recent call first\): + CMP0075.cmake:26 \(check_include_file_cxx\) + CMakeLists.txt:[0-9]+ \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. ++ +CMake Warning \(dev\) at [^ +]*/Modules/CheckIncludeFiles.cmake:[0-9]+ \(message\): + Policy CMP0075 is not set: Include file check macros honor + CMAKE_REQUIRED_LIBRARIES. Run "cmake --help-policy CMP0075" for policy + details. Use the cmake_policy command to set the policy and suppress this + warning. + + CMAKE_REQUIRED_LIBRARIES is set to: + + does_not_exist + + For compatibility with CMake 3.11 and below this check is ignoring it. +Call Stack \(most recent call first\): + CMP0075.cmake:41 \(check_include_files\) + CMakeLists.txt:[0-9]+ \(include\) +This warning is for project developers. Use -Wno-dev to suppress it.$ diff --git a/Tests/RunCMake/CheckModules/CMP0075.cmake b/Tests/RunCMake/CheckModules/CMP0075.cmake new file mode 100644 index 0000000..4a3b720 --- /dev/null +++ b/Tests/RunCMake/CheckModules/CMP0075.cmake @@ -0,0 +1,124 @@ +enable_language(C) +enable_language(CXX) +include(CheckIncludeFile) +include(CheckIncludeFileCXX) +include(CheckIncludeFiles) + +set(CMAKE_REQUIRED_LIBRARIES does_not_exist) + +#============================================================================ + +check_include_file("stddef.h" HAVE_STDDEF_H_1) +if(NOT HAVE_STDDEF_H_1) + message(SEND_ERROR "HAVE_STDDEF_H_1 failed but should have passed.") +endif() +if(NOT _CIF_CMP0075_WARNED) + message(SEND_ERROR "HAVE_STDDEF_H_1 did not warn but should have") +endif() +check_include_file("stddef.h" HAVE_STDDEF_H_2) # second does not warn +if(NOT HAVE_STDDEF_H_2) + message(SEND_ERROR "HAVE_STDDEF_H_2 failed but should have passed.") +endif() +unset(_CIF_CMP0075_WARNED) + +#---------------------------------------------------------------------------- + +check_include_file_cxx("stddef.h" HAVE_STDDEF_H_CXX_1) +if(NOT HAVE_STDDEF_H_CXX_1) + message(SEND_ERROR "HAVE_STDDEF_H_CXX_1 failed but should have passed.") +endif() +if(NOT _CIF_CMP0075_WARNED) + message(SEND_ERROR "HAVE_STDDEF_H_CXX_1 did not warn but should have") +endif() +check_include_file_cxx("stddef.h" HAVE_STDDEF_H_CXX_2) # second does not warn +if(NOT HAVE_STDDEF_H_CXX_2) + message(SEND_ERROR "HAVE_STDDEF_H_CXX_2 failed but should have passed.") +endif() +unset(_CIF_CMP0075_WARNED) + +#---------------------------------------------------------------------------- + +check_include_files("stddef.h;stdlib.h" HAVE_STDLIB_H_1) +if(NOT HAVE_STDLIB_H_1) + message(SEND_ERROR "HAVE_STDLIB_H_1 failed but should have passed.") +endif() +if(NOT _CIF_CMP0075_WARNED) + message(SEND_ERROR "HAVE_STDLIB_H_1 did not warn but should have") +endif() +check_include_files("stddef.h;stdlib.h" HAVE_STDLIB_H_2) # second does not warn +if(NOT HAVE_STDLIB_H_2) + message(SEND_ERROR "HAVE_STDLIB_H_2 failed but should have passed.") +endif() +unset(_CIF_CMP0075_WARNED) + +#============================================================================ +cmake_policy(SET CMP0075 OLD) +# These should not warn. +# These should pass the checks due to ignoring 'does_not_exist'. + +check_include_file("stddef.h" HAVE_STDDEF_H_3) +if(NOT HAVE_STDDEF_H_3) + message(SEND_ERROR "HAVE_STDDEF_H_3 failed but should have passed.") +endif() +if(_CIF_CMP0075_WARNED) + message(SEND_ERROR "HAVE_STDDEF_H_3 warned but should not have") +endif() +unset(_CIF_CMP0075_WARNED) + +#---------------------------------------------------------------------------- + +check_include_file_cxx("stddef.h" HAVE_STDDEF_H_CXX_3) +if(NOT HAVE_STDDEF_H_CXX_3) + message(SEND_ERROR "HAVE_STDDEF_H_CXX_3 failed but should have passed.") +endif() +if(_CIF_CMP0075_WARNED) + message(SEND_ERROR "HAVE_STDDEF_H_CXX_3 warned but should not have") +endif() +unset(_CIF_CMP0075_WARNED) + +#---------------------------------------------------------------------------- + +check_include_files("stddef.h;stdlib.h" HAVE_STDLIB_H_3) +if(NOT HAVE_STDLIB_H_3) + message(SEND_ERROR "HAVE_STDLIB_H_3 failed but should have passed.") +endif() +if(_CIF_CMP0075_WARNED) + message(SEND_ERROR "HAVE_STDLIB_H_3 warned but should not have") +endif() +unset(_CIF_CMP0075_WARNED) + +#============================================================================ +cmake_policy(SET CMP0075 NEW) +# These should not warn. +# These should fail the checks due to requiring 'does_not_exist'. + +check_include_file("stddef.h" HAVE_STDDEF_H_4) +if(HAVE_STDDEF_H_4) + message(SEND_ERROR "HAVE_STDDEF_H_4 passed but should have failed.") +endif() +if(_CIF_CMP0075_WARNED) + message(SEND_ERROR "HAVE_STDDEF_H_4 warned but should not have") +endif() +unset(_CIF_CMP0075_WARNED) + +#---------------------------------------------------------------------------- + +check_include_file_cxx("stddef.h" HAVE_STDDEF_H_CXX_4) +if(HAVE_STDDEF_H_CXX_4) + message(SEND_ERROR "HAVE_STDDEF_H_CXX_4 passed but should have failed.") +endif() +if(_CIF_CMP0075_WARNED) + message(SEND_ERROR "HAVE_STDDEF_H_CXX_4 warned but should not have") +endif() +unset(_CIF_CMP0075_WARNED) + +#---------------------------------------------------------------------------- + +check_include_files("stddef.h;stdlib.h" HAVE_STDLIB_H_4) +if(HAVE_STDLIB_H_4) + message(SEND_ERROR "HAVE_STDLIB_H_4 passed but should have failed.") +endif() +if(_CIF_CMP0075_WARNED) + message(SEND_ERROR "HAVE_STDLIB_H_4 warned but should not have") +endif() +unset(_CIF_CMP0075_WARNED) diff --git a/Tests/RunCMake/CheckModules/RunCMakeTest.cmake b/Tests/RunCMake/CheckModules/RunCMakeTest.cmake index c5aaa64..8a046e1 100644 --- a/Tests/RunCMake/CheckModules/RunCMakeTest.cmake +++ b/Tests/RunCMake/CheckModules/RunCMakeTest.cmake @@ -1,5 +1,7 @@ include(RunCMake) +run_cmake(CMP0075) + run_cmake(CheckStructHasMemberOk) run_cmake(CheckStructHasMemberUnknownLanguage) run_cmake(CheckStructHasMemberMissingLanguage) diff --git a/Tests/RunCMake/VS10Project/ExplicitCMakeLists-check.cmake b/Tests/RunCMake/VS10Project/ExplicitCMakeLists-check.cmake new file mode 100644 index 0000000..b671e35 --- /dev/null +++ b/Tests/RunCMake/VS10Project/ExplicitCMakeLists-check.cmake @@ -0,0 +1,25 @@ +set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.vcxproj") +if(NOT EXISTS "${vcProjectFile}") + set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.") + return() +endif() + +set(foundCMakeLists 0) +file(STRINGS "${vcProjectFile}" lines) +foreach(line IN LISTS lines) + if(line MATCHES "<([A-Za-z0-9_]+) +Include=.*CMakeLists.txt") + set(rule "${CMAKE_MATCH_1}") + if(NOT rule STREQUAL "CustomBuild") + set(RunCMake_TEST_FAILED "CMakeLists.txt referenced as ${rule} instead of CustomBuild") + return() + endif() + if(foundCMakeLists) + set(RunCMake_TEST_FAILED "CMakeLists.txt referenced multiple times") + return() + endif() + set(foundCMakeLists 1) + endif() +endforeach() +if(NOT foundCMakeLists) + set(RunCMake_TEST_FAILED "CMakeLists.txt not referenced") +endif() diff --git a/Tests/RunCMake/VS10Project/ExplicitCMakeLists.cmake b/Tests/RunCMake/VS10Project/ExplicitCMakeLists.cmake new file mode 100644 index 0000000..c9e4456 --- /dev/null +++ b/Tests/RunCMake/VS10Project/ExplicitCMakeLists.cmake @@ -0,0 +1,3 @@ +set(CMAKE_CONFIGURATION_TYPES Debug) +enable_language(CXX) +add_executable(foo foo.cpp ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt) diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake index 359cdfb..0d178ce 100644 --- a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake +++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake @@ -1,4 +1,7 @@ include(RunCMake) + +run_cmake(ExplicitCMakeLists) + run_cmake(VsConfigurationType) run_cmake(VsTargetsFileReferences) run_cmake(VsCustomProps) diff --git a/Tests/RunCMake/XcodeProject/ExplicitCMakeLists-check.cmake b/Tests/RunCMake/XcodeProject/ExplicitCMakeLists-check.cmake new file mode 100644 index 0000000..3073e0b --- /dev/null +++ b/Tests/RunCMake/XcodeProject/ExplicitCMakeLists-check.cmake @@ -0,0 +1,20 @@ +set(xcProjectFile "${RunCMake_TEST_BINARY_DIR}/ExplicitCMakeLists.xcodeproj/project.pbxproj") +if(NOT EXISTS "${xcProjectFile}") + set(RunCMake_TEST_FAILED "Project file ${xcProjectFile} does not exist.") + return() +endif() + +set(foundCMakeLists 0) +file(STRINGS "${xcProjectFile}" lines) +foreach(line IN LISTS lines) + if(line MATCHES "PBXBuildFile.*fileRef.*CMakeLists.txt") + if(foundCMakeLists) + set(RunCMake_TEST_FAILED "CMakeLists.txt referenced multiple times") + return() + endif() + set(foundCMakeLists 1) + endif() +endforeach() +if(NOT foundCMakeLists) + set(RunCMake_TEST_FAILED "CMakeLists.txt not referenced") +endif() diff --git a/Tests/RunCMake/XcodeProject/ExplicitCMakeLists.cmake b/Tests/RunCMake/XcodeProject/ExplicitCMakeLists.cmake new file mode 100644 index 0000000..678b0ea --- /dev/null +++ b/Tests/RunCMake/XcodeProject/ExplicitCMakeLists.cmake @@ -0,0 +1,2 @@ +enable_language(CXX) +add_executable(foo foo.cpp ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt) diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake index 5eff6b9..1150666 100644 --- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake +++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake @@ -4,6 +4,8 @@ if(XCODE_VERSION VERSION_GREATER_EQUAL 9) set(IOS_DEPLOYMENT_TARGET "-DCMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET=10") endif() +run_cmake(ExplicitCMakeLists) + run_cmake(XcodeFileType) run_cmake(XcodeAttributeLocation) run_cmake(XcodeAttributeGenex) diff --git a/Tests/RunCMake/list/RunCMakeTest.cmake b/Tests/RunCMake/list/RunCMakeTest.cmake index 3913783..bdc23a4 100644 --- a/Tests/RunCMake/list/RunCMakeTest.cmake +++ b/Tests/RunCMake/list/RunCMakeTest.cmake @@ -43,3 +43,44 @@ run_cmake(SUBLIST-NoArguments) run_cmake(SUBLIST-NoVariable) run_cmake(SUBLIST-InvalidLength) run_cmake(SUBLIST) + +run_cmake(TRANSFORM-NoAction) +run_cmake(TRANSFORM-InvalidAction) +# 'action' oriented tests +run_cmake(TRANSFORM-TOUPPER-TooManyArguments) +run_cmake(TRANSFORM-TOLOWER-TooManyArguments) +run_cmake(TRANSFORM-STRIP-TooManyArguments) +run_cmake(TRANSFORM-GENEX_STRIP-TooManyArguments) +run_cmake(TRANSFORM-APPEND-NoArguments) +run_cmake(TRANSFORM-APPEND-TooManyArguments) +run_cmake(TRANSFORM-PREPEND-NoArguments) +run_cmake(TRANSFORM-PREPEND-TooManyArguments) +run_cmake(TRANSFORM-REPLACE-NoArguments) +run_cmake(TRANSFORM-REPLACE-NoEnoughArguments) +run_cmake(TRANSFORM-REPLACE-TooManyArguments) +run_cmake(TRANSFORM-REPLACE-InvalidRegex) +run_cmake(TRANSFORM-REPLACE-InvalidReplace1) +run_cmake(TRANSFORM-REPLACE-InvalidReplace2) +# 'selector' oriented tests +run_cmake(TRANSFORM-Selector-REGEX-NoArguments) +run_cmake(TRANSFORM-Selector-REGEX-TooManyArguments) +run_cmake(TRANSFORM-Selector-REGEX-InvalidRegex) +run_cmake(TRANSFORM-Selector-AT-NoArguments) +run_cmake(TRANSFORM-Selector-AT-BadArgument) +run_cmake(TRANSFORM-Selector-AT-InvalidIndex) +run_cmake(TRANSFORM-Selector-FOR-NoArguments) +run_cmake(TRANSFORM-Selector-FOR-NoEnoughArguments) +run_cmake(TRANSFORM-Selector-FOR-TooManyArguments) +run_cmake(TRANSFORM-Selector-FOR-BadArgument) +run_cmake(TRANSFORM-Selector-FOR-InvalidIndex) +# 'output' oriented tests +run_cmake(TRANSFORM-Output-OUTPUT_VARIABLE-NoArguments) +run_cmake(TRANSFORM-Output-OUTPUT_VARIABLE-TooManyArguments) +# Successful tests +run_cmake(TRANSFORM-TOUPPER) +run_cmake(TRANSFORM-TOLOWER) +run_cmake(TRANSFORM-STRIP) +run_cmake(TRANSFORM-GENEX_STRIP) +run_cmake(TRANSFORM-APPEND) +run_cmake(TRANSFORM-PREPEND) +run_cmake(TRANSFORM-REPLACE) diff --git a/Tests/RunCMake/list/TRANSFORM-APPEND-NoArguments-result.txt b/Tests/RunCMake/list/TRANSFORM-APPEND-NoArguments-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-APPEND-NoArguments-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/TRANSFORM-APPEND-NoArguments-stderr.txt b/Tests/RunCMake/list/TRANSFORM-APPEND-NoArguments-stderr.txt new file mode 100644 index 0000000..028f8d5 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-APPEND-NoArguments-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at TRANSFORM-APPEND-NoArguments.cmake:2 \(list\): + list sub-command TRANSFORM, action APPEND expects 1 argument\(s\). +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/TRANSFORM-APPEND-NoArguments.cmake b/Tests/RunCMake/list/TRANSFORM-APPEND-NoArguments.cmake new file mode 100644 index 0000000..f161187 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-APPEND-NoArguments.cmake @@ -0,0 +1,2 @@ +set(mylist alpha bravo charlie) +list(TRANSFORM mylist APPEND) diff --git a/Tests/RunCMake/list/TRANSFORM-APPEND-TooManyArguments-result.txt b/Tests/RunCMake/list/TRANSFORM-APPEND-TooManyArguments-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-APPEND-TooManyArguments-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/TRANSFORM-APPEND-TooManyArguments-stderr.txt b/Tests/RunCMake/list/TRANSFORM-APPEND-TooManyArguments-stderr.txt new file mode 100644 index 0000000..aeb646d --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-APPEND-TooManyArguments-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at TRANSFORM-APPEND-TooManyArguments.cmake:2 \(list\): + list sub-command TRANSFORM, 'one_too_many': unexpected argument\(s\). +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/TRANSFORM-APPEND-TooManyArguments.cmake b/Tests/RunCMake/list/TRANSFORM-APPEND-TooManyArguments.cmake new file mode 100644 index 0000000..8430a4c --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-APPEND-TooManyArguments.cmake @@ -0,0 +1,2 @@ +set(mylist alpha bravo charlie) +list(TRANSFORM mylist APPEND delta one_too_many) diff --git a/Tests/RunCMake/list/TRANSFORM-APPEND.cmake b/Tests/RunCMake/list/TRANSFORM-APPEND.cmake new file mode 100644 index 0000000..9639088 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-APPEND.cmake @@ -0,0 +1,48 @@ +set(mylist alpha bravo charlie delta) + +list(TRANSFORM mylist APPEND "_A" OUTPUT_VARIABLE output) +if (NOT output STREQUAL "alpha_A;bravo_A;charlie_A;delta_A") + message (FATAL_ERROR "TRANSFORM(APPEND) is \"${output}\", expected is \"alpha_A;bravo_A;charlie_A;delta_A\"") +endif() + +unset(output) +list(TRANSFORM mylist APPEND "_A" AT 1 3 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "alpha;bravo_A;charlie;delta_A") + message (FATAL_ERROR "TRANSFORM(APPEND) is \"${output}\", expected is \"alpha;bravo_A;charlie;delta_A\"") +endif() + +unset(output) +list(TRANSFORM mylist APPEND "_A" AT 1 -2 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "alpha;bravo_A;charlie_A;delta") + message (FATAL_ERROR "TRANSFORM(APPEND) is \"${output}\", expected is \"alpha;bravo_A;charlie_A;delta\"") +endif() + +unset(output) +list(TRANSFORM mylist APPEND "_A" FOR 1 2 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "alpha;bravo_A;charlie_A;delta") + message (FATAL_ERROR "TRANSFORM(APPEND) is \"${output}\", expected is \"alpha;bravo_A;charlie_A;delta\"") +endif() + +unset(output) +list(TRANSFORM mylist APPEND "_A" FOR 1 -1 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "alpha;bravo_A;charlie_A;delta_A") + message (FATAL_ERROR "TRANSFORM(APPEND) is \"${output}\", expected is \"alpha;bravo_A;charlie_A;delta_A\"") +endif() + +unset(output) +list(TRANSFORM mylist APPEND "_A" FOR 0 -1 2 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "alpha_A;bravo;charlie_A;delta") + message (FATAL_ERROR "TRANSFORM(APPEND) is \"${output}\", expected is \"alpha_A;bravo;charlie_A;delta\"") +endif() + +unset(output) +list(TRANSFORM mylist APPEND "_A" REGEX "(r|t)a" OUTPUT_VARIABLE output) +if (NOT output STREQUAL "alpha;bravo_A;charlie;delta_A") + message (FATAL_ERROR "TRANSFORM(APPEND) is \"${output}\", expected is \"alpha;bravo_A;charlie;delta_A\"") +endif() + +unset(output) +list(TRANSFORM mylist APPEND "_A" REGEX "(r|t)a") +if (NOT mylist STREQUAL "alpha;bravo_A;charlie;delta_A") + message (FATAL_ERROR "TRANSFORM(APPEND) is \"${mylist}\", expected is \"alpha;bravo_A;charlie;delta_A\"") +endif() diff --git a/Tests/RunCMake/list/TRANSFORM-GENEX_STRIP-TooManyArguments-result.txt b/Tests/RunCMake/list/TRANSFORM-GENEX_STRIP-TooManyArguments-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-GENEX_STRIP-TooManyArguments-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/TRANSFORM-GENEX_STRIP-TooManyArguments-stderr.txt b/Tests/RunCMake/list/TRANSFORM-GENEX_STRIP-TooManyArguments-stderr.txt new file mode 100644 index 0000000..6071a00 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-GENEX_STRIP-TooManyArguments-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at TRANSFORM-GENEX_STRIP-TooManyArguments.cmake:2 \(list\): + list sub-command TRANSFORM, 'one_too_many': unexpected argument\(s\). +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/TRANSFORM-GENEX_STRIP-TooManyArguments.cmake b/Tests/RunCMake/list/TRANSFORM-GENEX_STRIP-TooManyArguments.cmake new file mode 100644 index 0000000..257d7fe --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-GENEX_STRIP-TooManyArguments.cmake @@ -0,0 +1,2 @@ +set(mylist alpha bravo charlie) +list(TRANSFORM mylist GENEX_STRIP one_too_many) diff --git a/Tests/RunCMake/list/TRANSFORM-GENEX_STRIP.cmake b/Tests/RunCMake/list/TRANSFORM-GENEX_STRIP.cmake new file mode 100644 index 0000000..8045eef --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-GENEX_STRIP.cmake @@ -0,0 +1,49 @@ +set(mylist one "$<1:two\;three>" four "$<TARGET_OBJECTS:some_target>") + +list(TRANSFORM mylist GENEX_STRIP OUTPUT_VARIABLE output) +if (NOT output STREQUAL "one;;four;") + message (FATAL_ERROR "TRANSFORM(GENEX_STRIP) is \"${output}\", expected is \"one;;four;\"") +endif() + +set(mylist "one $<CONFIG>" "$<1:two\;three>-$<PLATFORM_ID>" "$<ANGLE-R>four" "$<TARGET_OBJECTS:some_target>") +unset(output) +list(TRANSFORM mylist GENEX_STRIP AT 1 3 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "one $<CONFIG>;-;$<ANGLE-R>four;") + message (FATAL_ERROR "TRANSFORM(GENEX_STRIP) is \"${output}\", expected is \"one $<CONFIG>;-;$<ANGLE-R>four;\"") +endif() + +unset(output) +list(TRANSFORM mylist GENEX_STRIP AT 1 -2 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "one $<CONFIG>;-;four;$<TARGET_OBJECTS:some_target>") + message (FATAL_ERROR "TRANSFORM(GENEX_STRIP) is \"${output}\", expected is \"one $<CONFIG>;-;four;$<TARGET_OBJECTS:some_target>\"") +endif() + +unset(output) +list(TRANSFORM mylist GENEX_STRIP FOR 1 2 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "one $<CONFIG>;-;four;$<TARGET_OBJECTS:some_target>") + message (FATAL_ERROR "TRANSFORM(GENEX_STRIP) is \"${output}\", expected is \"one $<CONFIG>;-;four;$<TARGET_OBJECTS:some_target>\"") +endif() + +unset(output) +list(TRANSFORM mylist GENEX_STRIP FOR 1 -1 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "one $<CONFIG>;-;four;") + message (FATAL_ERROR "TRANSFORM(GENEX_STRIP) is \"${output}\", expected is \"one $<CONFIG>;-;four;\"") +endif() + +unset(output) +list(TRANSFORM mylist GENEX_STRIP FOR 0 -1 2 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "one ;$<1:two;three>-$<PLATFORM_ID>;four;$<TARGET_OBJECTS:some_target>") + message (FATAL_ERROR "TRANSFORM(GENEX_STRIP) is \"${output}\", expected is \"one ;$<1:two;three>-$<PLATFORM_ID>;four;$<TARGET_OBJECTS:some_target>\"") +endif() + +unset(output) +list(TRANSFORM mylist GENEX_STRIP REGEX "(D|G)>" OUTPUT_VARIABLE output) +if (NOT output STREQUAL "one ;-;$<ANGLE-R>four;$<TARGET_OBJECTS:some_target>") + message (FATAL_ERROR "TRANSFORM(GENEX_STRIP) is \"${output}\", expected is \"one ;-;$<ANGLE-R>four;$<TARGET_OBJECTS:some_target>\"") +endif() + +unset(output) +list(TRANSFORM mylist GENEX_STRIP REGEX "(D|G)>") +if (NOT mylist STREQUAL "one ;-;$<ANGLE-R>four;$<TARGET_OBJECTS:some_target>") + message (FATAL_ERROR "TRANSFORM(GENEX_STRIP) is \"${mylist}\", expected is \"one ;-;$<ANGLE-R>four;$<TARGET_OBJECTS:some_target>\"") +endif() diff --git a/Tests/RunCMake/list/TRANSFORM-InvalidAction-result.txt b/Tests/RunCMake/list/TRANSFORM-InvalidAction-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-InvalidAction-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/TRANSFORM-InvalidAction-stderr.txt b/Tests/RunCMake/list/TRANSFORM-InvalidAction-stderr.txt new file mode 100644 index 0000000..0fa45c9 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-InvalidAction-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at TRANSFORM-InvalidAction.cmake:2 \(list\): + list sub-command TRANSFORM, BAD_ACTION invalid action. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/TRANSFORM-InvalidAction.cmake b/Tests/RunCMake/list/TRANSFORM-InvalidAction.cmake new file mode 100644 index 0000000..fb2cc30 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-InvalidAction.cmake @@ -0,0 +1,2 @@ +set(mylist alpha bravo charlie) +list(TRANSFORM mylist BAD_ACTION) diff --git a/Tests/RunCMake/list/TRANSFORM-NoAction-result.txt b/Tests/RunCMake/list/TRANSFORM-NoAction-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-NoAction-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/TRANSFORM-NoAction-stderr.txt b/Tests/RunCMake/list/TRANSFORM-NoAction-stderr.txt new file mode 100644 index 0000000..68e9e9d --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-NoAction-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at TRANSFORM-NoAction.cmake:2 \(list\): + list sub-command TRANSFORM requires an action to be specified. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/TRANSFORM-NoAction.cmake b/Tests/RunCMake/list/TRANSFORM-NoAction.cmake new file mode 100644 index 0000000..3690f14 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-NoAction.cmake @@ -0,0 +1,2 @@ +set(mylist alpha bravo charlie) +list(TRANSFORM mylist) diff --git a/Tests/RunCMake/list/TRANSFORM-Output-OUTPUT_VARIABLE-NoArguments-result.txt b/Tests/RunCMake/list/TRANSFORM-Output-OUTPUT_VARIABLE-NoArguments-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Output-OUTPUT_VARIABLE-NoArguments-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/TRANSFORM-Output-OUTPUT_VARIABLE-NoArguments-stderr.txt b/Tests/RunCMake/list/TRANSFORM-Output-OUTPUT_VARIABLE-NoArguments-stderr.txt new file mode 100644 index 0000000..b4f4e06 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Output-OUTPUT_VARIABLE-NoArguments-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at TRANSFORM-Output-OUTPUT_VARIABLE-NoArguments.cmake:2 \(list\): + list sub-command TRANSFORM, OUTPUT_VARIABLE expects variable name argument. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/TRANSFORM-Output-OUTPUT_VARIABLE-NoArguments.cmake b/Tests/RunCMake/list/TRANSFORM-Output-OUTPUT_VARIABLE-NoArguments.cmake new file mode 100644 index 0000000..acc4094 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Output-OUTPUT_VARIABLE-NoArguments.cmake @@ -0,0 +1,2 @@ +set(mylist alpha bravo charlie) +list(TRANSFORM mylist TOUPPER OUTPUT_VARIABLE) diff --git a/Tests/RunCMake/list/TRANSFORM-Output-OUTPUT_VARIABLE-TooManyArguments-result.txt b/Tests/RunCMake/list/TRANSFORM-Output-OUTPUT_VARIABLE-TooManyArguments-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Output-OUTPUT_VARIABLE-TooManyArguments-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/TRANSFORM-Output-OUTPUT_VARIABLE-TooManyArguments-stderr.txt b/Tests/RunCMake/list/TRANSFORM-Output-OUTPUT_VARIABLE-TooManyArguments-stderr.txt new file mode 100644 index 0000000..9a58346 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Output-OUTPUT_VARIABLE-TooManyArguments-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at TRANSFORM-Output-OUTPUT_VARIABLE-TooManyArguments.cmake:2 \(list\): + list sub-command TRANSFORM, 'one_too_many': unexpected argument\(s\). +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/TRANSFORM-Output-OUTPUT_VARIABLE-TooManyArguments.cmake b/Tests/RunCMake/list/TRANSFORM-Output-OUTPUT_VARIABLE-TooManyArguments.cmake new file mode 100644 index 0000000..c4da864 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Output-OUTPUT_VARIABLE-TooManyArguments.cmake @@ -0,0 +1,2 @@ +set(mylist alpha bravo charlie) +list(TRANSFORM mylist TOUPPER OUTPUT_VARIABLE output one_too_many) diff --git a/Tests/RunCMake/list/TRANSFORM-PREPEND-NoArguments-result.txt b/Tests/RunCMake/list/TRANSFORM-PREPEND-NoArguments-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-PREPEND-NoArguments-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/TRANSFORM-PREPEND-NoArguments-stderr.txt b/Tests/RunCMake/list/TRANSFORM-PREPEND-NoArguments-stderr.txt new file mode 100644 index 0000000..413ce30 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-PREPEND-NoArguments-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at TRANSFORM-PREPEND-NoArguments.cmake:2 \(list\): + list sub-command TRANSFORM, action PREPEND expects 1 argument\(s\). +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/TRANSFORM-PREPEND-NoArguments.cmake b/Tests/RunCMake/list/TRANSFORM-PREPEND-NoArguments.cmake new file mode 100644 index 0000000..a8e4530 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-PREPEND-NoArguments.cmake @@ -0,0 +1,2 @@ +set(mylist alpha bravo charlie) +list(TRANSFORM mylist PREPEND) diff --git a/Tests/RunCMake/list/TRANSFORM-PREPEND-TooManyArguments-result.txt b/Tests/RunCMake/list/TRANSFORM-PREPEND-TooManyArguments-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-PREPEND-TooManyArguments-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/TRANSFORM-PREPEND-TooManyArguments-stderr.txt b/Tests/RunCMake/list/TRANSFORM-PREPEND-TooManyArguments-stderr.txt new file mode 100644 index 0000000..6ff1b89 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-PREPEND-TooManyArguments-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at TRANSFORM-PREPEND-TooManyArguments.cmake:2 \(list\): + list sub-command TRANSFORM, 'one_too_many': unexpected argument\(s\). +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/TRANSFORM-PREPEND-TooManyArguments.cmake b/Tests/RunCMake/list/TRANSFORM-PREPEND-TooManyArguments.cmake new file mode 100644 index 0000000..1f904ad --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-PREPEND-TooManyArguments.cmake @@ -0,0 +1,2 @@ +set(mylist alpha bravo charlie) +list(TRANSFORM mylist PREPEND delta one_too_many) diff --git a/Tests/RunCMake/list/TRANSFORM-PREPEND.cmake b/Tests/RunCMake/list/TRANSFORM-PREPEND.cmake new file mode 100644 index 0000000..55b8867 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-PREPEND.cmake @@ -0,0 +1,48 @@ +set(mylist alpha bravo charlie delta) + +list(TRANSFORM mylist PREPEND "P_" OUTPUT_VARIABLE output) +if (NOT output STREQUAL "P_alpha;P_bravo;P_charlie;P_delta") + message (FATAL_ERROR "TRANSFORM(PREPEND) is \"${output}\", expected is \"P_alpha;P_bravo;P_charlie;P_delta\"") +endif() + +unset(output) +list(TRANSFORM mylist PREPEND "P_" AT 1 3 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "alpha;P_bravo;charlie;P_delta") + message (FATAL_ERROR "TRANSFORM(PREPEND) is \"${output}\", expected is \"alpha;P_bravo;charlie;P_delta\"") +endif() + +unset(output) +list(TRANSFORM mylist PREPEND "P_" AT 1 -2 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "alpha;P_bravo;P_charlie;delta") + message (FATAL_ERROR "TRANSFORM(PREPEND) is \"${output}\", expected is \"alpha;P_bravo;P_charlie;delta\"") +endif() + +unset(output) +list(TRANSFORM mylist PREPEND "P_" FOR 1 2 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "alpha;P_bravo;P_charlie;delta") + message (FATAL_ERROR "TRANSFORM(PREPEND) is \"${output}\", expected is \"alpha;P_bravo;P_charlie;delta\"") +endif() + +unset(output) +list(TRANSFORM mylist PREPEND "P_" FOR 1 -1 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "alpha;P_bravo;P_charlie;P_delta") + message (FATAL_ERROR "TRANSFORM(PREPEND) is \"${output}\", expected is \"alpha;P_bravo;P_charlie;P_delta\"") +endif() + +unset(output) +list(TRANSFORM mylist PREPEND "P_" FOR 0 -1 2 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "P_alpha;bravo;P_charlie;delta") + message (FATAL_ERROR "TRANSFORM(PREPEND) is \"${output}\", expected is \"P_alpha;bravo;P_charlie;delta\"") +endif() + +unset(output) +list(TRANSFORM mylist PREPEND "P_" REGEX "(r|t)a" OUTPUT_VARIABLE output) +if (NOT output STREQUAL "alpha;P_bravo;charlie;P_delta") + message (FATAL_ERROR "TRANSFORM(PREPEND) is \"${output}\", expected is \"alpha;P_bravo;charlie;P_delta\"") +endif() + +unset(output) +list(TRANSFORM mylist PREPEND "P_" REGEX "(r|t)a") +if (NOT mylist STREQUAL "alpha;P_bravo;charlie;P_delta") + message (FATAL_ERROR "TRANSFORM(PREPEND) is \"${mylist}\", expected is \"alpha;P_bravo;charlie;P_delta\"") +endif() diff --git a/Tests/RunCMake/list/TRANSFORM-REPLACE-InvalidRegex-result.txt b/Tests/RunCMake/list/TRANSFORM-REPLACE-InvalidRegex-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-REPLACE-InvalidRegex-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/TRANSFORM-REPLACE-InvalidRegex-stderr.txt b/Tests/RunCMake/list/TRANSFORM-REPLACE-InvalidRegex-stderr.txt new file mode 100644 index 0000000..334c96e --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-REPLACE-InvalidRegex-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error at TRANSFORM-REPLACE-InvalidRegex.cmake:2 \(list\): + list sub-command TRANSFORM, action REPLACE: Failed to compile regex + "\^\(alpha\$". +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/TRANSFORM-REPLACE-InvalidRegex.cmake b/Tests/RunCMake/list/TRANSFORM-REPLACE-InvalidRegex.cmake new file mode 100644 index 0000000..f440c35 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-REPLACE-InvalidRegex.cmake @@ -0,0 +1,2 @@ +set(mylist alpha bravo charlie) +list(TRANSFORM mylist REPLACE "^(alpha$" "zulu") diff --git a/Tests/RunCMake/list/TRANSFORM-REPLACE-InvalidReplace-result.txt b/Tests/RunCMake/list/TRANSFORM-REPLACE-InvalidReplace-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-REPLACE-InvalidReplace-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/TRANSFORM-REPLACE-InvalidReplace1-result.txt b/Tests/RunCMake/list/TRANSFORM-REPLACE-InvalidReplace1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-REPLACE-InvalidReplace1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/TRANSFORM-REPLACE-InvalidReplace1-stderr.txt b/Tests/RunCMake/list/TRANSFORM-REPLACE-InvalidReplace1-stderr.txt new file mode 100644 index 0000000..7671c83 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-REPLACE-InvalidReplace1-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error at TRANSFORM-REPLACE-InvalidReplace1.cmake:2 \(list\): + list sub-command TRANSFORM, action REPLACE: replace-expression ends in a + backslash. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/TRANSFORM-REPLACE-InvalidReplace1.cmake b/Tests/RunCMake/list/TRANSFORM-REPLACE-InvalidReplace1.cmake new file mode 100644 index 0000000..35387f0 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-REPLACE-InvalidReplace1.cmake @@ -0,0 +1,2 @@ +set(mylist alpha bravo charlie) +list(TRANSFORM mylist REPLACE "^alpha$" "zulu\\") diff --git a/Tests/RunCMake/list/TRANSFORM-REPLACE-InvalidReplace2-result.txt b/Tests/RunCMake/list/TRANSFORM-REPLACE-InvalidReplace2-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-REPLACE-InvalidReplace2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/TRANSFORM-REPLACE-InvalidReplace2-stderr.txt b/Tests/RunCMake/list/TRANSFORM-REPLACE-InvalidReplace2-stderr.txt new file mode 100644 index 0000000..e0aabd7 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-REPLACE-InvalidReplace2-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error at TRANSFORM-REPLACE-InvalidReplace2.cmake:2 \(list\): + list sub-command TRANSFORM, action REPLACE: Unknown escape "\\z" in + replace-expression. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/TRANSFORM-REPLACE-InvalidReplace2.cmake b/Tests/RunCMake/list/TRANSFORM-REPLACE-InvalidReplace2.cmake new file mode 100644 index 0000000..2f1f2c7 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-REPLACE-InvalidReplace2.cmake @@ -0,0 +1,2 @@ +set(mylist alpha bravo charlie) +list(TRANSFORM mylist REPLACE "^alpha$" "\\zulu") diff --git a/Tests/RunCMake/list/TRANSFORM-REPLACE-NoArguments-result.txt b/Tests/RunCMake/list/TRANSFORM-REPLACE-NoArguments-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-REPLACE-NoArguments-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/TRANSFORM-REPLACE-NoArguments-stderr.txt b/Tests/RunCMake/list/TRANSFORM-REPLACE-NoArguments-stderr.txt new file mode 100644 index 0000000..3d39e72 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-REPLACE-NoArguments-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at TRANSFORM-REPLACE-NoArguments.cmake:2 \(list\): + list sub-command TRANSFORM, action REPLACE expects 2 argument\(s\). +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/TRANSFORM-REPLACE-NoArguments.cmake b/Tests/RunCMake/list/TRANSFORM-REPLACE-NoArguments.cmake new file mode 100644 index 0000000..b7b1e9d --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-REPLACE-NoArguments.cmake @@ -0,0 +1,2 @@ +set(mylist alpha bravo charlie) +list(TRANSFORM mylist REPLACE) diff --git a/Tests/RunCMake/list/TRANSFORM-REPLACE-NoEnoughArguments-result.txt b/Tests/RunCMake/list/TRANSFORM-REPLACE-NoEnoughArguments-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-REPLACE-NoEnoughArguments-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/TRANSFORM-REPLACE-NoEnoughArguments-stderr.txt b/Tests/RunCMake/list/TRANSFORM-REPLACE-NoEnoughArguments-stderr.txt new file mode 100644 index 0000000..dc80f33 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-REPLACE-NoEnoughArguments-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at TRANSFORM-REPLACE-NoEnoughArguments.cmake:2 \(list\): + list sub-command TRANSFORM, action REPLACE expects 2 argument\(s\). +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/TRANSFORM-REPLACE-NoEnoughArguments.cmake b/Tests/RunCMake/list/TRANSFORM-REPLACE-NoEnoughArguments.cmake new file mode 100644 index 0000000..1d418c0 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-REPLACE-NoEnoughArguments.cmake @@ -0,0 +1,2 @@ +set(mylist alpha bravo charlie) +list(TRANSFORM mylist REPLACE "^alpha$") diff --git a/Tests/RunCMake/list/TRANSFORM-REPLACE-TooManyArguments-result.txt b/Tests/RunCMake/list/TRANSFORM-REPLACE-TooManyArguments-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-REPLACE-TooManyArguments-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/TRANSFORM-REPLACE-TooManyArguments-stderr.txt b/Tests/RunCMake/list/TRANSFORM-REPLACE-TooManyArguments-stderr.txt new file mode 100644 index 0000000..3d4e15a --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-REPLACE-TooManyArguments-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at TRANSFORM-REPLACE-TooManyArguments.cmake:2 \(list\): + list sub-command TRANSFORM, 'one_too_many': unexpected argument\(s\). +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/TRANSFORM-REPLACE-TooManyArguments.cmake b/Tests/RunCMake/list/TRANSFORM-REPLACE-TooManyArguments.cmake new file mode 100644 index 0000000..baed0af --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-REPLACE-TooManyArguments.cmake @@ -0,0 +1,2 @@ +set(mylist alpha bravo charlie) +list(TRANSFORM mylist REPLACE "^alpha$" "zulu" "one_too_many") diff --git a/Tests/RunCMake/list/TRANSFORM-REPLACE.cmake b/Tests/RunCMake/list/TRANSFORM-REPLACE.cmake new file mode 100644 index 0000000..256b1b8 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-REPLACE.cmake @@ -0,0 +1,48 @@ +set(mylist alpha bravo charlie delta) + +list(TRANSFORM mylist REPLACE "(.+a)$" "\\1_\\1" OUTPUT_VARIABLE output) +if (NOT output STREQUAL "alpha_alpha;bravo;charlie;delta_delta") + message (FATAL_ERROR "TRANSFORM(REPLACE) is \"${output}\", expected is \"alpha_alpha;bravo;charlie;delta_delta\"") +endif() + +unset(output) +list(TRANSFORM mylist REPLACE "(.+a)$" "\\1_\\1" AT 1 3 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "alpha;bravo;charlie;delta_delta") + message (FATAL_ERROR "TRANSFORM(REPLACE) is \"${output}\", expected is \"alpha;bravo;charlie;delta_delta\"") +endif() + +unset(output) +list(TRANSFORM mylist REPLACE "(.+e)$" "\\1_\\1" AT 1 -2 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "alpha;bravo;charlie_charlie;delta") + message (FATAL_ERROR "TRANSFORM(REPLACE) is \"${output}\", expected is \"alpha;bravo;charlie_charlie;delta\"") +endif() + +unset(output) +list(TRANSFORM mylist REPLACE "(.+e)$" "\\1_\\1" FOR 1 2 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "alpha;bravo;charlie_charlie;delta") + message (FATAL_ERROR "TRANSFORM(REPLACE) is \"${output}\", expected is \"alpha;bravo;charlie_charlie;delta\"") +endif() + +unset(output) +list(TRANSFORM mylist REPLACE "(.+a)$" "\\1_\\1" FOR 1 -1 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "alpha;bravo;charlie;delta_delta") + message (FATAL_ERROR "TRANSFORM(REPLACE) is \"${output}\", expected is \"alpha;bravo;charlie_A;delta_delta\"") +endif() + +unset(output) +list(TRANSFORM mylist REPLACE "(.+a)$" "\\1_\\1" FOR 0 -1 2 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "alpha_alpha;bravo;charlie;delta") + message (FATAL_ERROR "TRANSFORM(REPLACE) is \"${output}\", expected is \"alpha_alpha;bravo;charlie;delta\"") +endif() + +unset(output) +list(TRANSFORM mylist REPLACE "(.+a)$" "\\1_\\1" REGEX "(r|t)a" OUTPUT_VARIABLE output) +if (NOT output STREQUAL "alpha;bravo;charlie;delta_delta") + message (FATAL_ERROR "TRANSFORM(REPLACE) is \"${output}\", expected is \"alpha;bravo;charlie;delta_delta\"") +endif() + +unset(output) +list(TRANSFORM mylist REPLACE "(.+a)$" "\\1_\\1" REGEX "(r|t)a") +if (NOT mylist STREQUAL "alpha;bravo;charlie;delta_delta") + message (FATAL_ERROR "TRANSFORM(REPLACE) is \"${mylist}\", expected is \"alpha;bravo;charlie;delta_delta\"") +endif() diff --git a/Tests/RunCMake/list/TRANSFORM-STRIP-TooManyArguments-result.txt b/Tests/RunCMake/list/TRANSFORM-STRIP-TooManyArguments-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-STRIP-TooManyArguments-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/TRANSFORM-STRIP-TooManyArguments-stderr.txt b/Tests/RunCMake/list/TRANSFORM-STRIP-TooManyArguments-stderr.txt new file mode 100644 index 0000000..534f940 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-STRIP-TooManyArguments-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at TRANSFORM-STRIP-TooManyArguments.cmake:2 \(list\): + list sub-command TRANSFORM, 'one_too_many': unexpected argument\(s\). +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/TRANSFORM-STRIP-TooManyArguments.cmake b/Tests/RunCMake/list/TRANSFORM-STRIP-TooManyArguments.cmake new file mode 100644 index 0000000..c6a8213 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-STRIP-TooManyArguments.cmake @@ -0,0 +1,2 @@ +set(mylist alpha bravo charlie) +list(TRANSFORM mylist STRIP one_too_many) diff --git a/Tests/RunCMake/list/TRANSFORM-STRIP.cmake b/Tests/RunCMake/list/TRANSFORM-STRIP.cmake new file mode 100644 index 0000000..366c63a --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-STRIP.cmake @@ -0,0 +1,49 @@ +set(mylist " alpha" "bravo " " charlie " delta) + +list(TRANSFORM mylist STRIP OUTPUT_VARIABLE output) +if (NOT output STREQUAL "alpha;bravo;charlie;delta") + message (FATAL_ERROR "TRANSFORM(STRIP) is \"${output}\", expected is \"alpha;bravo;charlie;delta\"") +endif() + +set(mylist " alpha" "bravo " " charlie " "delta ") +unset(output) +list(TRANSFORM mylist STRIP AT 1 3 OUTPUT_VARIABLE output) +if (NOT output STREQUAL " alpha;bravo; charlie ;delta") + message (FATAL_ERROR "TRANSFORM(STRIP) is \"${output}\", expected is \" alpha;bravo; charlie ;delta\"") +endif() + +unset(output) +list(TRANSFORM mylist STRIP AT 1 -2 OUTPUT_VARIABLE output) +if (NOT output STREQUAL " alpha;bravo;charlie;delta ") + message (FATAL_ERROR "TRANSFORM(STRIP) is \"${output}\", expected is \" alpha;bravo;charlie;delta \"") +endif() + +unset(output) +list(TRANSFORM mylist STRIP FOR 1 2 OUTPUT_VARIABLE output) +if (NOT output STREQUAL " alpha;bravo;charlie;delta ") + message (FATAL_ERROR "TRANSFORM(STRIP) is \"${output}\", expected is \" alpha;bravo;charlie;delta \"") +endif() + +unset(output) +list(TRANSFORM mylist STRIP FOR 1 -1 OUTPUT_VARIABLE output) +if (NOT output STREQUAL " alpha;bravo;charlie;delta") + message (FATAL_ERROR "TRANSFORM(STRIP) is \"${output}\", expected is \" alpha;bravo;charlie;delta\"") +endif() + +unset(output) +list(TRANSFORM mylist STRIP FOR 0 -1 2 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "alpha;bravo ;charlie;delta ") + message (FATAL_ERROR "TRANSFORM(STRIP) is \"${output}\", expected is \"alpha;bravo ;charlie;delta \"") +endif() + +unset(output) +list(TRANSFORM mylist STRIP REGEX "(r|t)a" OUTPUT_VARIABLE output) +if (NOT output STREQUAL " alpha;bravo; charlie ;delta") + message (FATAL_ERROR "TRANSFORM(STRIP) is \"${output}\", expected is \" alpha;bravo; charlie ;delta\"") +endif() + +unset(output) +list(TRANSFORM mylist STRIP REGEX "(r|t)a") +if (NOT mylist STREQUAL " alpha;bravo; charlie ;delta") + message (FATAL_ERROR "TRANSFORM(STRIP) is \"${mylist}\", expected is \" alpha;bravo; charlie ;delta\"") +endif() diff --git a/Tests/RunCMake/list/TRANSFORM-Selector-AT-BadArgument-result.txt b/Tests/RunCMake/list/TRANSFORM-Selector-AT-BadArgument-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Selector-AT-BadArgument-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/TRANSFORM-Selector-AT-BadArgument-stderr.txt b/Tests/RunCMake/list/TRANSFORM-Selector-AT-BadArgument-stderr.txt new file mode 100644 index 0000000..cec520f --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Selector-AT-BadArgument-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at TRANSFORM-Selector-AT-BadArgument.cmake:2 \(list\): + list sub-command TRANSFORM, '1x 2': unexpected argument\(s\). +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/TRANSFORM-Selector-AT-BadArgument.cmake b/Tests/RunCMake/list/TRANSFORM-Selector-AT-BadArgument.cmake new file mode 100644 index 0000000..f61b86b --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Selector-AT-BadArgument.cmake @@ -0,0 +1,2 @@ +set(mylist alpha bravo charlie) +list(TRANSFORM mylist TOUPPER AT 0 1x 2) diff --git a/Tests/RunCMake/list/TRANSFORM-Selector-AT-InvalidIndex-result.txt b/Tests/RunCMake/list/TRANSFORM-Selector-AT-InvalidIndex-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Selector-AT-InvalidIndex-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/TRANSFORM-Selector-AT-InvalidIndex-stderr.txt b/Tests/RunCMake/list/TRANSFORM-Selector-AT-InvalidIndex-stderr.txt new file mode 100644 index 0000000..7e2898b --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Selector-AT-InvalidIndex-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at TRANSFORM-Selector-AT-InvalidIndex.cmake:2 \(list\): + list sub-command TRANSFORM, selector AT, index: 3 out of range \(-3, 2\). +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/TRANSFORM-Selector-AT-InvalidIndex.cmake b/Tests/RunCMake/list/TRANSFORM-Selector-AT-InvalidIndex.cmake new file mode 100644 index 0000000..d33586c --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Selector-AT-InvalidIndex.cmake @@ -0,0 +1,2 @@ +set(mylist alpha bravo charlie) +list(TRANSFORM mylist TOUPPER AT 0 3 2) diff --git a/Tests/RunCMake/list/TRANSFORM-Selector-AT-NoArguments-result.txt b/Tests/RunCMake/list/TRANSFORM-Selector-AT-NoArguments-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Selector-AT-NoArguments-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/TRANSFORM-Selector-AT-NoArguments-stderr.txt b/Tests/RunCMake/list/TRANSFORM-Selector-AT-NoArguments-stderr.txt new file mode 100644 index 0000000..eaf5281 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Selector-AT-NoArguments-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at TRANSFORM-Selector-AT-NoArguments.cmake:2 \(list\): + list sub-command TRANSFORM, selector AT expects at least one numeric value. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/TRANSFORM-Selector-AT-NoArguments.cmake b/Tests/RunCMake/list/TRANSFORM-Selector-AT-NoArguments.cmake new file mode 100644 index 0000000..052b79b --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Selector-AT-NoArguments.cmake @@ -0,0 +1,2 @@ +set(mylist alpha bravo charlie) +list(TRANSFORM mylist TOUPPER AT) diff --git a/Tests/RunCMake/list/TRANSFORM-Selector-FOR-BadArgument-result.txt b/Tests/RunCMake/list/TRANSFORM-Selector-FOR-BadArgument-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Selector-FOR-BadArgument-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/TRANSFORM-Selector-FOR-BadArgument-stderr.txt b/Tests/RunCMake/list/TRANSFORM-Selector-FOR-BadArgument-stderr.txt new file mode 100644 index 0000000..a0f701f --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Selector-FOR-BadArgument-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error at TRANSFORM-Selector-FOR-BadArgument.cmake:2 \(list\): + list sub-command TRANSFORM, selector FOR expects, at least, two numeric + values. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/TRANSFORM-Selector-FOR-BadArgument.cmake b/Tests/RunCMake/list/TRANSFORM-Selector-FOR-BadArgument.cmake new file mode 100644 index 0000000..55527be --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Selector-FOR-BadArgument.cmake @@ -0,0 +1,2 @@ +set(mylist alpha bravo charlie) +list(TRANSFORM mylist TOUPPER FOR 0 1x 2) diff --git a/Tests/RunCMake/list/TRANSFORM-Selector-FOR-InvalidIndex-result.txt b/Tests/RunCMake/list/TRANSFORM-Selector-FOR-InvalidIndex-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Selector-FOR-InvalidIndex-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/TRANSFORM-Selector-FOR-InvalidIndex-stderr.txt b/Tests/RunCMake/list/TRANSFORM-Selector-FOR-InvalidIndex-stderr.txt new file mode 100644 index 0000000..c50cc0a --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Selector-FOR-InvalidIndex-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at TRANSFORM-Selector-FOR-InvalidIndex.cmake:2 \(list\): + list sub-command TRANSFORM, selector FOR, index: 6 out of range \(-3, 2\). +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/TRANSFORM-Selector-FOR-InvalidIndex.cmake b/Tests/RunCMake/list/TRANSFORM-Selector-FOR-InvalidIndex.cmake new file mode 100644 index 0000000..6e2374e --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Selector-FOR-InvalidIndex.cmake @@ -0,0 +1,2 @@ +set(mylist alpha bravo charlie) +list(TRANSFORM mylist TOUPPER FOR 0 6 2) diff --git a/Tests/RunCMake/list/TRANSFORM-Selector-FOR-NoArguments-result.txt b/Tests/RunCMake/list/TRANSFORM-Selector-FOR-NoArguments-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Selector-FOR-NoArguments-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/TRANSFORM-Selector-FOR-NoArguments-stderr.txt b/Tests/RunCMake/list/TRANSFORM-Selector-FOR-NoArguments-stderr.txt new file mode 100644 index 0000000..5881b67 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Selector-FOR-NoArguments-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at TRANSFORM-Selector-FOR-NoArguments.cmake:2 \(list\): + list sub-command TRANSFORM, selector FOR expects, at least, two arguments. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/TRANSFORM-Selector-FOR-NoArguments.cmake b/Tests/RunCMake/list/TRANSFORM-Selector-FOR-NoArguments.cmake new file mode 100644 index 0000000..4902cc9 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Selector-FOR-NoArguments.cmake @@ -0,0 +1,2 @@ +set(mylist alpha bravo charlie) +list(TRANSFORM mylist TOUPPER FOR) diff --git a/Tests/RunCMake/list/TRANSFORM-Selector-FOR-NoEnoughArguments-result.txt b/Tests/RunCMake/list/TRANSFORM-Selector-FOR-NoEnoughArguments-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Selector-FOR-NoEnoughArguments-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/TRANSFORM-Selector-FOR-NoEnoughArguments-stderr.txt b/Tests/RunCMake/list/TRANSFORM-Selector-FOR-NoEnoughArguments-stderr.txt new file mode 100644 index 0000000..b1081d9 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Selector-FOR-NoEnoughArguments-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at TRANSFORM-Selector-FOR-NoEnoughArguments.cmake:2 \(list\): + list sub-command TRANSFORM, selector FOR expects, at least, two arguments. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/TRANSFORM-Selector-FOR-NoEnoughArguments.cmake b/Tests/RunCMake/list/TRANSFORM-Selector-FOR-NoEnoughArguments.cmake new file mode 100644 index 0000000..81417de --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Selector-FOR-NoEnoughArguments.cmake @@ -0,0 +1,2 @@ +set(mylist alpha bravo charlie) +list(TRANSFORM mylist TOUPPER FOR 1) diff --git a/Tests/RunCMake/list/TRANSFORM-Selector-FOR-TooManyArguments-result.txt b/Tests/RunCMake/list/TRANSFORM-Selector-FOR-TooManyArguments-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Selector-FOR-TooManyArguments-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/TRANSFORM-Selector-FOR-TooManyArguments-stderr.txt b/Tests/RunCMake/list/TRANSFORM-Selector-FOR-TooManyArguments-stderr.txt new file mode 100644 index 0000000..2221cb3 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Selector-FOR-TooManyArguments-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at TRANSFORM-Selector-FOR-TooManyArguments.cmake:2 \(list\): + list sub-command TRANSFORM, '3': unexpected argument\(s\). +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/TRANSFORM-Selector-FOR-TooManyArguments.cmake b/Tests/RunCMake/list/TRANSFORM-Selector-FOR-TooManyArguments.cmake new file mode 100644 index 0000000..80917d6 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Selector-FOR-TooManyArguments.cmake @@ -0,0 +1,2 @@ +set(mylist alpha bravo charlie) +list(TRANSFORM mylist TOUPPER FOR 0 1 2 3) diff --git a/Tests/RunCMake/list/TRANSFORM-Selector-REGEX-InvalidRegex-result.txt b/Tests/RunCMake/list/TRANSFORM-Selector-REGEX-InvalidRegex-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Selector-REGEX-InvalidRegex-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/TRANSFORM-Selector-REGEX-InvalidRegex-stderr.txt b/Tests/RunCMake/list/TRANSFORM-Selector-REGEX-InvalidRegex-stderr.txt new file mode 100644 index 0000000..31ba939 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Selector-REGEX-InvalidRegex-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error at TRANSFORM-Selector-REGEX-InvalidRegex.cmake:2 \(list\): + list sub-command TRANSFORM, selector REGEX failed to compile regex + "\^\(alpha\$". +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/TRANSFORM-Selector-REGEX-InvalidRegex.cmake b/Tests/RunCMake/list/TRANSFORM-Selector-REGEX-InvalidRegex.cmake new file mode 100644 index 0000000..56e202b --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Selector-REGEX-InvalidRegex.cmake @@ -0,0 +1,2 @@ +set(mylist alpha bravo charlie) +list(TRANSFORM mylist TOUPPER REGEX "^(alpha$") diff --git a/Tests/RunCMake/list/TRANSFORM-Selector-REGEX-NoArguments-result.txt b/Tests/RunCMake/list/TRANSFORM-Selector-REGEX-NoArguments-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Selector-REGEX-NoArguments-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/TRANSFORM-Selector-REGEX-NoArguments-stderr.txt b/Tests/RunCMake/list/TRANSFORM-Selector-REGEX-NoArguments-stderr.txt new file mode 100644 index 0000000..2784785 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Selector-REGEX-NoArguments-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error at TRANSFORM-Selector-REGEX-NoArguments.cmake:2 \(list\): + list sub-command TRANSFORM, selector REGEX expects 'regular expression' + argument. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/TRANSFORM-Selector-REGEX-NoArguments.cmake b/Tests/RunCMake/list/TRANSFORM-Selector-REGEX-NoArguments.cmake new file mode 100644 index 0000000..f199d0e --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Selector-REGEX-NoArguments.cmake @@ -0,0 +1,2 @@ +set(mylist alpha bravo charlie) +list(TRANSFORM mylist TOUPPER REGEX) diff --git a/Tests/RunCMake/list/TRANSFORM-Selector-REGEX-TooManyArguments-result.txt b/Tests/RunCMake/list/TRANSFORM-Selector-REGEX-TooManyArguments-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Selector-REGEX-TooManyArguments-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/TRANSFORM-Selector-REGEX-TooManyArguments-stderr.txt b/Tests/RunCMake/list/TRANSFORM-Selector-REGEX-TooManyArguments-stderr.txt new file mode 100644 index 0000000..db5b1ff --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Selector-REGEX-TooManyArguments-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at TRANSFORM-Selector-REGEX-TooManyArguments.cmake:2 \(list\): + list sub-command TRANSFORM, 'one_too_many': unexpected argument\(s\). +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/TRANSFORM-Selector-REGEX-TooManyArguments.cmake b/Tests/RunCMake/list/TRANSFORM-Selector-REGEX-TooManyArguments.cmake new file mode 100644 index 0000000..4aa1619 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-Selector-REGEX-TooManyArguments.cmake @@ -0,0 +1,2 @@ +set(mylist alpha bravo charlie) +list(TRANSFORM mylist TOUPPER REGEX "^alpha$" "one_too_many") diff --git a/Tests/RunCMake/list/TRANSFORM-TOLOWER-TooManyArguments-result.txt b/Tests/RunCMake/list/TRANSFORM-TOLOWER-TooManyArguments-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-TOLOWER-TooManyArguments-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/TRANSFORM-TOLOWER-TooManyArguments-stderr.txt b/Tests/RunCMake/list/TRANSFORM-TOLOWER-TooManyArguments-stderr.txt new file mode 100644 index 0000000..90248ae --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-TOLOWER-TooManyArguments-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at TRANSFORM-TOLOWER-TooManyArguments.cmake:2 \(list\): + list sub-command TRANSFORM, 'one_too_many': unexpected argument\(s\). +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/TRANSFORM-TOLOWER-TooManyArguments.cmake b/Tests/RunCMake/list/TRANSFORM-TOLOWER-TooManyArguments.cmake new file mode 100644 index 0000000..1758e19 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-TOLOWER-TooManyArguments.cmake @@ -0,0 +1,2 @@ +set(mylist alpha bravo charlie) +list(TRANSFORM mylist TOLOWER one_too_many) diff --git a/Tests/RunCMake/list/TRANSFORM-TOLOWER.cmake b/Tests/RunCMake/list/TRANSFORM-TOLOWER.cmake new file mode 100644 index 0000000..a2d7348 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-TOLOWER.cmake @@ -0,0 +1,48 @@ +set(mylist ALPHA BRAVO CHARLIE DELTA) + +list(TRANSFORM mylist TOLOWER OUTPUT_VARIABLE output) +if (NOT output STREQUAL "alpha;bravo;charlie;delta") + message (FATAL_ERROR "TRANSFORM(TOLOWER) is \"${output}\", expected is \"alpha;bravo;charlie;delta\"") +endif() + +unset(output) +list(TRANSFORM mylist TOLOWER AT 1 3 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "ALPHA;bravo;CHARLIE;delta") + message (FATAL_ERROR "TRANSFORM(TOLOWER) is \"${output}\", expected is \"ALPHA;bravo;CHARLIE;delta\"") +endif() + +unset(output) +list(TRANSFORM mylist TOLOWER AT 1 -2 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "ALPHA;bravo;charlie;DELTA") + message (FATAL_ERROR "TRANSFORM(TOLOWER) is \"${output}\", expected is \"ALPHA;bravo;charlie;DELTA\"") +endif() + +unset(output) +list(TRANSFORM mylist TOLOWER FOR 1 2 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "ALPHA;bravo;charlie;DELTA") + message (FATAL_ERROR "TRANSFORM(TOLOWER) is \"${output}\", expected is \"ALPHA;bravo;charlie;DELTA\"") +endif() + +unset(output) +list(TRANSFORM mylist TOLOWER FOR 1 -1 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "ALPHA;bravo;charlie;delta") + message (FATAL_ERROR "TRANSFORM(TOLOWER) is \"${output}\", expected is \"ALPHA;bravo;charlie;delta\"") +endif() + +unset(output) +list(TRANSFORM mylist TOLOWER FOR 0 -1 2 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "alpha;BRAVO;charlie;DELTA") + message (FATAL_ERROR "TRANSFORM(TOLOWER) is \"${output}\", expected is \"alpha;BRAVO;charlie;DELTA\"") +endif() + +unset(output) +list(TRANSFORM mylist TOLOWER REGEX "(R|T)A" OUTPUT_VARIABLE output) +if (NOT output STREQUAL "ALPHA;bravo;CHARLIE;delta") + message (FATAL_ERROR "TRANSFORM(TOLOWER) is \"${output}\", expected is \"ALPHA;bravo;CHARLIE;delta\"") +endif() + +unset(output) +list(TRANSFORM mylist TOLOWER REGEX "(R|T)A") +if (NOT mylist STREQUAL "ALPHA;bravo;CHARLIE;delta") + message (FATAL_ERROR "TRANSFORM(TOLOWER) is \"${mylist}\", expected is \"ALPHA;bravo;CHARLIE;delta\"") +endif() diff --git a/Tests/RunCMake/list/TRANSFORM-TOUPPER-TooManyArguments-result.txt b/Tests/RunCMake/list/TRANSFORM-TOUPPER-TooManyArguments-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-TOUPPER-TooManyArguments-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/TRANSFORM-TOUPPER-TooManyArguments-stderr.txt b/Tests/RunCMake/list/TRANSFORM-TOUPPER-TooManyArguments-stderr.txt new file mode 100644 index 0000000..9da241b --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-TOUPPER-TooManyArguments-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at TRANSFORM-TOUPPER-TooManyArguments.cmake:2 \(list\): + list sub-command TRANSFORM, 'one_too_many': unexpected argument\(s\). +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/TRANSFORM-TOUPPER-TooManyArguments.cmake b/Tests/RunCMake/list/TRANSFORM-TOUPPER-TooManyArguments.cmake new file mode 100644 index 0000000..58d6a8c --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-TOUPPER-TooManyArguments.cmake @@ -0,0 +1,2 @@ +set(mylist alpha bravo charlie) +list(TRANSFORM mylist TOUPPER one_too_many) diff --git a/Tests/RunCMake/list/TRANSFORM-TOUPPER.cmake b/Tests/RunCMake/list/TRANSFORM-TOUPPER.cmake new file mode 100644 index 0000000..5b1fcb6 --- /dev/null +++ b/Tests/RunCMake/list/TRANSFORM-TOUPPER.cmake @@ -0,0 +1,48 @@ +set(mylist alpha bravo charlie delta) + +list(TRANSFORM mylist TOUPPER OUTPUT_VARIABLE output) +if (NOT output STREQUAL "ALPHA;BRAVO;CHARLIE;DELTA") + message (FATAL_ERROR "TRANSFORM(TOUPPER) is \"${output}\", expected is \"ALPHA;BRAVO;CHARLIE;DELTA\"") +endif() + +unset(output) +list(TRANSFORM mylist TOUPPER AT 1 3 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "alpha;BRAVO;charlie;DELTA") + message (FATAL_ERROR "TRANSFORM(TOUPPER) is \"${output}\", expected is \"alpha;BRAVO;charlie;DELTA\"") +endif() + +unset(output) +list(TRANSFORM mylist TOUPPER AT 1 -2 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "alpha;BRAVO;CHARLIE;delta") + message (FATAL_ERROR "TRANSFORM(TOUPPER) is \"${output}\", expected is \"alpha;BRAVO;CHARLIE;delta\"") +endif() + +unset(output) +list(TRANSFORM mylist TOUPPER FOR 1 2 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "alpha;BRAVO;CHARLIE;delta") + message (FATAL_ERROR "TRANSFORM(TOUPPER) is \"${output}\", expected is \"alpha;BRAVO;CHARLIE;delta\"") +endif() + +unset(output) +list(TRANSFORM mylist TOUPPER FOR 1 -1 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "alpha;BRAVO;CHARLIE;DELTA") + message (FATAL_ERROR "TRANSFORM(TOUPPER) is \"${output}\", expected is \"alpha;BRAVO;CHARLIE;DELTA\"") +endif() + +unset(output) +list(TRANSFORM mylist TOUPPER FOR 0 -1 2 OUTPUT_VARIABLE output) +if (NOT output STREQUAL "ALPHA;bravo;CHARLIE;delta") + message (FATAL_ERROR "TRANSFORM(TOUPPER) is \"${output}\", expected is \"ALPHA;bravo;CHARLIE;delta\"") +endif() + +unset(output) +list(TRANSFORM mylist TOUPPER REGEX "(r|t)a" OUTPUT_VARIABLE output) +if (NOT output STREQUAL "alpha;BRAVO;charlie;DELTA") + message (FATAL_ERROR "TRANSFORM(TOUPPER) is \"${output}\", expected is \"alpha;BRAVO;charlie;DELTA\"") +endif() + +unset(output) +list(TRANSFORM mylist TOUPPER REGEX "(r|t)a") +if (NOT mylist STREQUAL "alpha;BRAVO;charlie;DELTA") + message (FATAL_ERROR "TRANSFORM(TOUPPER) is \"${mylist}\", expected is \"alpha;BRAVO;charlie;DELTA\"") +endif() |