diff options
Diffstat (limited to 'Tests')
19 files changed, 91 insertions, 10 deletions
diff --git a/Tests/Module/ExternalData/CMakeLists.txt b/Tests/Module/ExternalData/CMakeLists.txt index 5a6f3d5..ebca48e 100644 --- a/Tests/Module/ExternalData/CMakeLists.txt +++ b/Tests/Module/ExternalData/CMakeLists.txt @@ -23,6 +23,8 @@ ExternalData_Add_Test(Data1 COMMAND ${CMAKE_COMMAND} -D Data=DATA{Data.dat} ${Data1CheckSpaces} + -D DataMissing=DATA{DataMissing.dat} + -D DataMissingWithAssociated=DATA{DataMissing.dat,Data.dat} -D SeriesA=DATA{SeriesA.dat,:} -D SeriesB=DATA{SeriesB.dat,:} -D SeriesC=DATA{SeriesC.dat,:} diff --git a/Tests/Module/ExternalData/Data1Check.cmake b/Tests/Module/ExternalData/Data1Check.cmake index 5770245..485b5c6 100644 --- a/Tests/Module/ExternalData/Data1Check.cmake +++ b/Tests/Module/ExternalData/Data1Check.cmake @@ -8,6 +8,28 @@ if(DEFINED DataSpace) message(SEND_ERROR "Input file:\n ${DataSpace}\ndoes not have expected content, but [[${lines}]]") endif() endif() +if(DataMissing) + if(EXISTS "${DataMissing}") + message(SEND_ERROR + "Input file:\n" + " ${DataMissing}\n" + "exists but should not." + ) + endif() +else() + message(SEND_ERROR "DataMissing is not set!") +endif() +if(DataMissingWithAssociated) + if(EXISTS "${DataMissingWithAssociated}") + message(SEND_ERROR + "Input file:\n" + " ${DataMissingWithAssociated}\n" + "exists but should not." + ) + endif() +else() + message(SEND_ERROR "DataMissingWithAssociated is not set!") +endif() set(SeriesAn1 "1\\.dat") set(SeriesBn1 "_1\\.dat") set(SeriesCn1 "\\.1\\.dat") diff --git a/Tests/RunCMake/ExternalData/Directory1-stderr.txt b/Tests/RunCMake/ExternalData/Directory1-stderr.txt index 85c250f..2bc3c60 100644 --- a/Tests/RunCMake/ExternalData/Directory1-stderr.txt +++ b/Tests/RunCMake/ExternalData/Directory1-stderr.txt @@ -7,7 +7,7 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): Directory1 - that does not exist as a file \(with or without an extension\)! + that is directory instead of a file! Call Stack \(most recent call first\): .* Directory1.cmake:3 \(ExternalData_Add_Test\) diff --git a/Tests/RunCMake/ExternalData/Directory3-result.txt b/Tests/RunCMake/ExternalData/Directory3-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/ExternalData/Directory3-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/ExternalData/Directory3-stderr.txt b/Tests/RunCMake/ExternalData/Directory3-stderr.txt index 56a341e..ceed2a0 100644 --- a/Tests/RunCMake/ExternalData/Directory3-stderr.txt +++ b/Tests/RunCMake/ExternalData/Directory3-stderr.txt @@ -1,4 +1,4 @@ -CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): +CMake Warning \(dev\) at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): Data file referenced by argument DATA{Directory3/\*} @@ -12,3 +12,4 @@ Call Stack \(most recent call first\): .* Directory3.cmake:3 \(ExternalData_Add_Test\) CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/ExternalData/MissingData-result.txt b/Tests/RunCMake/ExternalData/MissingData-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/ExternalData/MissingData-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/ExternalData/MissingData-stderr.txt b/Tests/RunCMake/ExternalData/MissingData-stderr.txt index e794f95..39ed2f1 100644 --- a/Tests/RunCMake/ExternalData/MissingData-stderr.txt +++ b/Tests/RunCMake/ExternalData/MissingData-stderr.txt @@ -1,4 +1,4 @@ -CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): +CMake Warning \(dev\) at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): Data file referenced by argument DATA{MissingData.txt} @@ -10,5 +10,6 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): that does not exist as a file \(with or without an extension\)! Call Stack \(most recent call first\): .* - MissingData.cmake:2 \(ExternalData_Add_Test\) + MissingData.cmake:4 \(ExternalData_Expand_Arguments\) CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/ExternalData/MissingData-stdout.txt b/Tests/RunCMake/ExternalData/MissingData-stdout.txt new file mode 100644 index 0000000..addd40e --- /dev/null +++ b/Tests/RunCMake/ExternalData/MissingData-stdout.txt @@ -0,0 +1 @@ +-- Missing data reference correctly transformed! diff --git a/Tests/RunCMake/ExternalData/MissingData.cmake b/Tests/RunCMake/ExternalData/MissingData.cmake index b3c8a5c..f5fefd5 100644 --- a/Tests/RunCMake/ExternalData/MissingData.cmake +++ b/Tests/RunCMake/ExternalData/MissingData.cmake @@ -1,5 +1,10 @@ include(ExternalData) -ExternalData_Add_Test(Data - NAME Test - COMMAND ${CMAKE_COMMAND} -E echo DATA{MissingData.txt} - ) + +set(output "${CMAKE_SOURCE_DIR}/MissingData.txt") +ExternalData_Expand_Arguments(Data args DATA{MissingData.txt}) +if("x${args}" STREQUAL "x${output}") + message(STATUS "Missing data reference correctly transformed!") +else() + message(FATAL_ERROR "Missing data reference transformed to:\n ${args}\n" + "but we expected:\n ${output}") +endif() diff --git a/Tests/RunCMake/ExternalData/MissingDataWithAssociated-stderr.txt b/Tests/RunCMake/ExternalData/MissingDataWithAssociated-stderr.txt new file mode 100644 index 0000000..315af5e --- /dev/null +++ b/Tests/RunCMake/ExternalData/MissingDataWithAssociated-stderr.txt @@ -0,0 +1,15 @@ +CMake Warning \(dev\) at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): + Data file referenced by argument + + DATA{MissingData.txt,Data.txt} + + corresponds to source tree path + + MissingData.txt + + that does not exist as a file \(with or without an extension\)! +Call Stack \(most recent call first\): + .* + MissingDataWithAssociated.cmake:4 \(ExternalData_Expand_Arguments\) + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/ExternalData/MissingDataWithAssociated-stdout.txt b/Tests/RunCMake/ExternalData/MissingDataWithAssociated-stdout.txt new file mode 100644 index 0000000..addd40e --- /dev/null +++ b/Tests/RunCMake/ExternalData/MissingDataWithAssociated-stdout.txt @@ -0,0 +1 @@ +-- Missing data reference correctly transformed! diff --git a/Tests/RunCMake/ExternalData/MissingDataWithAssociated.cmake b/Tests/RunCMake/ExternalData/MissingDataWithAssociated.cmake new file mode 100644 index 0000000..a4c4638 --- /dev/null +++ b/Tests/RunCMake/ExternalData/MissingDataWithAssociated.cmake @@ -0,0 +1,10 @@ +include(ExternalData) + +set(output "${CMAKE_BINARY_DIR}/MissingData.txt") +ExternalData_Expand_Arguments(Data args DATA{MissingData.txt,Data.txt}) +if("x${args}" STREQUAL "x${output}") + message(STATUS "Missing data reference correctly transformed!") +else() + message(FATAL_ERROR "Missing data reference transformed to:\n ${args}\n" + "but we expected:\n ${output}") +endif() diff --git a/Tests/RunCMake/ExternalData/RunCMakeTest.cmake b/Tests/RunCMake/ExternalData/RunCMakeTest.cmake index 93ff08f..04e3d59 100644 --- a/Tests/RunCMake/ExternalData/RunCMakeTest.cmake +++ b/Tests/RunCMake/ExternalData/RunCMakeTest.cmake @@ -15,6 +15,7 @@ run_cmake(LinkContentMD5) run_cmake(LinkContentSHA1) run_cmake(LinkDirectory1) run_cmake(MissingData) +run_cmake(MissingDataWithAssociated) run_cmake(NoLinkInSource) run_cmake(NoURLTemplates) run_cmake(NormalData1) diff --git a/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-WARN-stderr.txt b/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-WARN-stderr.txt index f6d408c..054bff5 100644 --- a/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-WARN-stderr.txt +++ b/Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-WARN-stderr.txt @@ -12,4 +12,9 @@ CMake Warning \(dev\) in CMakeLists.txt: of the install directory: ".*Tests/RunCMake/include_directories/prefix" + + however it is also a subdirectory of the build tree: + + ".*Tests/RunCMake/include_directories/prefix/BinInInstallPrefix-CMP0052-WARN-build" + This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/include_directories/DirInInstallPrefix-result.txt b/Tests/RunCMake/include_directories/DirInInstallPrefix-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/include_directories/DirInInstallPrefix-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/include_directories/DirInInstallPrefix-stderr.txt b/Tests/RunCMake/include_directories/DirInInstallPrefix-stderr.txt new file mode 100644 index 0000000..10f3293 --- /dev/null +++ b/Tests/RunCMake/include_directories/DirInInstallPrefix-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/include_directories/DirInInstallPrefix.cmake b/Tests/RunCMake/include_directories/DirInInstallPrefix.cmake new file mode 100644 index 0000000..d6f08bd --- /dev/null +++ b/Tests/RunCMake/include_directories/DirInInstallPrefix.cmake @@ -0,0 +1,9 @@ + +add_library(testTarget empty.cpp) +target_include_directories(testTarget INTERFACE "${CMAKE_INSTALL_PREFIX}/dir") + +install(TARGETS testTarget EXPORT testTargets + DESTINATION lib +) + +install(EXPORT testTargets DESTINATION lib/cmake) diff --git a/Tests/RunCMake/include_directories/RunCMakeTest.cmake b/Tests/RunCMake/include_directories/RunCMakeTest.cmake index 434beb9..c5b29d0 100644 --- a/Tests/RunCMake/include_directories/RunCMakeTest.cmake +++ b/Tests/RunCMake/include_directories/RunCMakeTest.cmake @@ -13,6 +13,9 @@ run_cmake(install_config) run_cmake(incomplete-genex) run_cmake(export-NOWARN) +set(RunCMake_TEST_OPTIONS "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/DirInInstallPrefix/prefix") +run_cmake(DirInInstallPrefix) + configure_file( "${RunCMake_SOURCE_DIR}/CMakeLists.txt" "${RunCMake_BINARY_DIR}/copy/CMakeLists.txt" diff --git a/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-WARN-stderr.txt b/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-WARN-stderr.txt index 78710c0..0b13fd8 100644 --- a/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-WARN-stderr.txt +++ b/Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-WARN-stderr.txt @@ -12,4 +12,9 @@ CMake Warning \(dev\) in CMakeLists.txt: of the install directory: ".*Tests/RunCMake/include_directories/prefix" + + however it is also a subdirectory of the source tree: + + ".*Tests/RunCMake/include_directories/prefix/src" + This warning is for project developers. Use -Wno-dev to suppress it. |