summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-04-06 12:44:45 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-04-06 12:44:53 (GMT)
commit2e029ec5983a2a81f2eb2fe3132bd4e20cc44e85 (patch)
tree4c9ca40a480743e57e360fab188bfef89eb1ae77 /Tests
parente061a201b63df75c15eb714f68e5097839222bda (diff)
parente17006c497acc3c8d37a9cd854c6ef451db7df9e (diff)
downloadCMake-2e029ec5983a2a81f2eb2fe3132bd4e20cc44e85.zip
CMake-2e029ec5983a2a81f2eb2fe3132bd4e20cc44e85.tar.gz
CMake-2e029ec5983a2a81f2eb2fe3132bd4e20cc44e85.tar.bz2
Merge topic 'rel-file-table' into release-3.20
e17006c497 Utilities/Release: Add deprecation fields to File Table v1 89ab613248 Utilities/Release: Update file table for 3.20.0 c5777e5421 Merge branch 'backport-3.19-rel-file-table' into rel-file-table f9f59fb0b2 Merge branch 'release-3.19' into backport-3.19-rel-file-table 30959aec8f Utilities/Release: Update file table for 3.19.3 d206c8f1ec Merge tag 'v3.19.3' into backport-3.19-rel-file-table 004dbbaddd Utilities/Release: Update file table for 3.19.2 1e3301a28c Merge tag 'v3.19.2' into backport-3.19-rel-file-table ... Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Ben Boeckel <ben.boeckel@kitware.com> Reviewed-by: Craig Scott <craig.scott@crascit.com> Merge-request: !5961
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/CMakeRelease/FileTable-stdout.txt44
-rw-r--r--Tests/RunCMake/CMakeRelease/FileTable.cmake21
-rw-r--r--Tests/RunCMake/CMakeRelease/RunCMakeTest.cmake10
-rw-r--r--Tests/RunCMake/RunCMake.cmake5
5 files changed, 81 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 5ee0612..f33e4af 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -224,6 +224,7 @@ if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Unix Makefiles|Ninja")
add_RunCMake_test(Byproducts)
endif()
add_RunCMake_test(CMakeRoleGlobalProperty)
+add_RunCMake_test(CMakeRelease -DCMake_TEST_JQ=${CMake_TEST_JQ})
if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Unix Makefiles|Ninja")
add_RunCMake_test(CompilerChange)
endif()
diff --git a/Tests/RunCMake/CMakeRelease/FileTable-stdout.txt b/Tests/RunCMake/CMakeRelease/FileTable-stdout.txt
new file mode 100644
index 0000000..37eb91e
--- /dev/null
+++ b/Tests/RunCMake/CMakeRelease/FileTable-stdout.txt
@@ -0,0 +1,44 @@
+^-- query: \.version \| \.major , \.minor , \.patch , \.suffix, \.string
+1
+2
+3
+"rc4"
+"@version@"
+-- query: \.files\[\]\.name
+"cmake-@version@-linux-aarch64\.sh"
+"cmake-@version@-linux-aarch64\.tar\.gz"
+"cmake-@version@-linux-x86_64\.sh"
+"cmake-@version@-linux-x86_64\.tar\.gz"
+"cmake-@version@-macos-universal\.dmg"
+"cmake-@version@-macos-universal\.tar\.gz"
+"cmake-@version@-macos10\.10-universal\.dmg"
+"cmake-@version@-macos10\.10-universal\.tar\.gz"
+"cmake-@version@-windows-i386\.msi"
+"cmake-@version@-windows-i386\.zip"
+"cmake-@version@-windows-x86_64\.msi"
+"cmake-@version@-windows-x86_64\.zip"
+"cmake-@version@\.tar\.gz"
+"cmake-@version@\.zip"
+-- query: \.files\[\] \| select\(\.os\[\] \| \. == "source"\) \| \.name
+"cmake-@version@\.tar\.gz"
+"cmake-@version@\.zip"
+-- query: \.files\[\] \| select\(\(\.os\[\] \| \. == "macOS"\) and \(\.class == "volume"\)\) \| \.name
+"cmake-@version@-macos-universal\.dmg"
+-- query: \.files\[\] \| select\(\(\.os\[\] \| \. == "macos10\.10"\) and \(\.class == "archive"\)\) \| \.name
+"cmake-@version@-macos10\.10-universal\.tar\.gz"
+-- query: \.files\[\] \| select\(\(\.os\[\] \| \. == "windows"\) and \(\.architecture\[\] \| \. == "i386"\) and \(\.class == "installer"\)\) \| \.name
+"cmake-@version@-windows-i386\.msi"
+-- query: \.files\[\] \| select\(\.architecture\[\] \| \. == "x86_64"\) \| \.name
+"cmake-@version@-linux-x86_64\.sh"
+"cmake-@version@-linux-x86_64\.tar\.gz"
+"cmake-@version@-macos-universal\.dmg"
+"cmake-@version@-macos-universal\.tar\.gz"
+"cmake-@version@-macos10\.10-universal\.dmg"
+"cmake-@version@-macos10\.10-universal\.tar\.gz"
+"cmake-@version@-windows-x86_64\.msi"
+"cmake-@version@-windows-x86_64\.zip"
+-- query: \.files\[\] \| select\(\[\.macOSmin\] \| inside\(\["10\.10", "10\.11", "10\.12"\]\)\) \| \.name
+"cmake-@version@-macos10\.10-universal\.dmg"
+"cmake-@version@-macos10\.10-universal\.tar\.gz"
+-- query: \.hashFiles\[\] \| select\(\.algorithm\[\] \| \. == "SHA-256"\) \| \.name
+"cmake-@version@-SHA-256\.txt"$
diff --git a/Tests/RunCMake/CMakeRelease/FileTable.cmake b/Tests/RunCMake/CMakeRelease/FileTable.cmake
new file mode 100644
index 0000000..f46535c
--- /dev/null
+++ b/Tests/RunCMake/CMakeRelease/FileTable.cmake
@@ -0,0 +1,21 @@
+set(version "@version@")
+set(version_major "1")
+set(version_minor "2")
+set(version_patch "3")
+set(maybe_version_suffix "\"suffix\": \"rc4\",")
+configure_file("${CMAKE_CURRENT_LIST_DIR}/../../../Utilities/Release/files-v1.json.in" "files-v1.json" @ONLY)
+
+foreach(query
+ ".version | .major , .minor , .patch , .suffix, .string"
+ ".files[].name"
+ ".files[] | select(.os[] | . == \"source\") | .name"
+ ".files[] | select((.os[] | . == \"macOS\") and (.class == \"volume\")) | .name"
+ ".files[] | select((.os[] | . == \"macos10.10\") and (.class == \"archive\")) | .name"
+ ".files[] | select((.os[] | . == \"windows\") and (.architecture[] | . == \"i386\") and (.class == \"installer\")) | .name"
+ ".files[] | select(.architecture[] | . == \"x86_64\") | .name"
+ ".files[] | select([.macOSmin] | inside([\"10.10\", \"10.11\", \"10.12\"])) | .name"
+ ".hashFiles[] | select(.algorithm[] | . == \"SHA-256\") | .name"
+ )
+ message(STATUS "query: ${query}")
+ execute_process(COMMAND ${JQ} "${query}" files-v1.json)
+endforeach()
diff --git a/Tests/RunCMake/CMakeRelease/RunCMakeTest.cmake b/Tests/RunCMake/CMakeRelease/RunCMakeTest.cmake
new file mode 100644
index 0000000..9a08ff3
--- /dev/null
+++ b/Tests/RunCMake/CMakeRelease/RunCMakeTest.cmake
@@ -0,0 +1,10 @@
+include(RunCMake)
+
+if(CMake_TEST_JQ)
+ set(JQ "${CMake_TEST_JQ}")
+else()
+ find_program(JQ NAMES jq)
+endif()
+if(JQ)
+ run_cmake_script(FileTable -DJQ=${JQ})
+endif()
diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake
index 494f87f..ea94a5b 100644
--- a/Tests/RunCMake/RunCMake.cmake
+++ b/Tests/RunCMake/RunCMake.cmake
@@ -215,6 +215,11 @@ function(run_cmake_command test)
run_cmake(${test})
endfunction()
+function(run_cmake_script test)
+ set(RunCMake_TEST_COMMAND ${CMAKE_COMMAND} ${ARGN} -P ${RunCMake_SOURCE_DIR}/${test}.cmake)
+ run_cmake(${test})
+endfunction()
+
function(run_cmake_with_options test)
set(RunCMake_TEST_OPTIONS "${ARGN}")
run_cmake(${test})