summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-08-30 13:24:23 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-08-30 13:24:31 (GMT)
commitb11e021bed6d406e3a7b9af6f5ef8fa5565881af (patch)
tree16d9b563cff8a6362c26c003458a21834d8c6747 /Tests
parente3a521f02bc1d6353581a1a58ae88bb0a432f165 (diff)
parent4a0f664aafb27a073e0a4856cdff6132f99fe627 (diff)
downloadCMake-b11e021bed6d406e3a7b9af6f5ef8fa5565881af.zip
CMake-b11e021bed6d406e3a7b9af6f5ef8fa5565881af.tar.gz
CMake-b11e021bed6d406e3a7b9af6f5ef8fa5565881af.tar.bz2
Merge topic 'cpack-ext-stage-and-run'
4a0f664aaf CPackExt: Add CPACK_EXT_ENABLE_STAGING and CPACK_EXT_PACKAGE_SCRIPT Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2272
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CPack/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/CPack/tests/EXT/ExpectedFiles.cmake3
-rw-r--r--Tests/RunCMake/CPack/tests/EXT/create_package.cmake24
-rw-r--r--Tests/RunCMake/CPack/tests/EXT/stage_and_package-stderr.txt1
-rw-r--r--Tests/RunCMake/CPack/tests/EXT/test.cmake3
5 files changed, 31 insertions, 2 deletions
diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake
index b273c1e..91fed3e 100644
--- a/Tests/RunCMake/CPack/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake
@@ -35,4 +35,4 @@ run_cpack_test(USER_FILELIST "RPM" false "MONOLITHIC")
run_cpack_test(MD5SUMS "DEB" false "MONOLITHIC;COMPONENT")
run_cpack_test(CPACK_INSTALL_SCRIPT "ZIP" false "MONOLITHIC")
run_cpack_test(DEB_PACKAGE_VERSION_BACK_COMPATIBILITY "DEB" false "MONOLITHIC;COMPONENT")
-run_cpack_test_subtests(EXT "none;good;good_multi;bad_major;bad_minor;invalid_good;invalid_bad" "Ext" false "MONOLITHIC;COMPONENT")
+run_cpack_test_subtests(EXT "none;good;good_multi;bad_major;bad_minor;invalid_good;invalid_bad;stage_and_package" "Ext" false "MONOLITHIC;COMPONENT")
diff --git a/Tests/RunCMake/CPack/tests/EXT/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/EXT/ExpectedFiles.cmake
index 2634111..91608c9 100644
--- a/Tests/RunCMake/CPack/tests/EXT/ExpectedFiles.cmake
+++ b/Tests/RunCMake/CPack/tests/EXT/ExpectedFiles.cmake
@@ -1,4 +1,5 @@
-if(RunCMake_SUBTEST_SUFFIX MATCHES "^(none|good(_multi)?|invalid_good)$")
+if(RunCMake_SUBTEST_SUFFIX MATCHES "^(none|good(_multi)?|invalid_good)$"
+ OR RunCMake_SUBTEST_SUFFIX STREQUAL "stage_and_package")
set(EXPECTED_FILES_COUNT "1")
set(EXPECTED_FILE_CONTENT_1_LIST "/share;/share/cpack-test;/share/cpack-test/f1.txt;/share/cpack-test/f2.txt;/share/cpack-test/f3.txt;/share/cpack-test/f4.txt")
else()
diff --git a/Tests/RunCMake/CPack/tests/EXT/create_package.cmake b/Tests/RunCMake/CPack/tests/EXT/create_package.cmake
new file mode 100644
index 0000000..e308ccb
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/EXT/create_package.cmake
@@ -0,0 +1,24 @@
+message("This script could run an external packaging tool")
+
+function(expect_variable VAR)
+ if(NOT ${VAR})
+ message(FATAL_ERROR "${VAR} is unexpectedly not set")
+ endif()
+endfunction()
+
+function(expect_file FILE)
+ if(NOT EXISTS "${FILE}")
+ message(FATAL_ERROR "${FILE} is unexpectedly missing")
+ endif()
+endfunction()
+
+expect_variable(CPACK_COMPONENTS_ALL)
+expect_variable(CPACK_TOPLEVEL_DIRECTORY)
+expect_variable(CPACK_TEMPORARY_DIRECTORY)
+expect_variable(CPACK_PACKAGE_DIRECTORY)
+expect_variable(CPACK_PACKAGE_FILE_NAME)
+
+expect_file(${CPACK_TEMPORARY_DIRECTORY}/f1/share/cpack-test/f1.txt)
+expect_file(${CPACK_TEMPORARY_DIRECTORY}/f2/share/cpack-test/f2.txt)
+expect_file(${CPACK_TEMPORARY_DIRECTORY}/f3/share/cpack-test/f3.txt)
+expect_file(${CPACK_TEMPORARY_DIRECTORY}/f4/share/cpack-test/f4.txt)
diff --git a/Tests/RunCMake/CPack/tests/EXT/stage_and_package-stderr.txt b/Tests/RunCMake/CPack/tests/EXT/stage_and_package-stderr.txt
new file mode 100644
index 0000000..40f2743
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/EXT/stage_and_package-stderr.txt
@@ -0,0 +1 @@
+^This script could run an external packaging tool$
diff --git a/Tests/RunCMake/CPack/tests/EXT/test.cmake b/Tests/RunCMake/CPack/tests/EXT/test.cmake
index 6bd3cb8..976cb6a 100644
--- a/Tests/RunCMake/CPack/tests/EXT/test.cmake
+++ b/Tests/RunCMake/CPack/tests/EXT/test.cmake
@@ -14,6 +14,9 @@ elseif(RunCMake_SUBTEST_SUFFIX STREQUAL "invalid_good")
set(CPACK_EXT_REQUESTED_VERSIONS "1;1.0")
elseif(RunCMake_SUBTEST_SUFFIX STREQUAL "invalid_bad")
set(CPACK_EXT_REQUESTED_VERSIONS "1")
+elseif(RunCMake_SUBTEST_SUFFIX STREQUAL "stage_and_package")
+ set(CPACK_EXT_ENABLE_STAGING 1)
+ set(CPACK_EXT_PACKAGE_SCRIPT "${CMAKE_CURRENT_LIST_DIR}/create_package.cmake")
endif()
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/f1.txt" test1)