summaryrefslogtreecommitdiffstats
path: root/Tests/CPackComponentsForAll
diff options
context:
space:
mode:
authorEric NOULARD <eric.noulard@gmail.com>2010-12-11 10:59:02 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2010-12-14 17:20:56 (GMT)
commitdd2a5aa69fa1ba9fc73740355971fc28bfb504c0 (patch)
tree8183d5f5bfcc905dae86463a06498200bc50ccd5 /Tests/CPackComponentsForAll
parent88b7f4252c86f655c026d0906e7a8396cf75b70c (diff)
downloadCMake-dd2a5aa69fa1ba9fc73740355971fc28bfb504c0.zip
CMake-dd2a5aa69fa1ba9fc73740355971fc28bfb504c0.tar.gz
CMake-dd2a5aa69fa1ba9fc73740355971fc28bfb504c0.tar.bz2
CPack Default component test for ZIP should be OK
Diffstat (limited to 'Tests/CPackComponentsForAll')
-rw-r--r--Tests/CPackComponentsForAll/CMakeLists.txt2
-rw-r--r--Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake19
2 files changed, 16 insertions, 5 deletions
diff --git a/Tests/CPackComponentsForAll/CMakeLists.txt b/Tests/CPackComponentsForAll/CMakeLists.txt
index 4153ac9..971b2dc 100644
--- a/Tests/CPackComponentsForAll/CMakeLists.txt
+++ b/Tests/CPackComponentsForAll/CMakeLists.txt
@@ -7,7 +7,7 @@
# Depending on the CPack generator and on some CPACK_xxx var values
# the generator may produce a single (NSIS, PackageMaker)
# or several package files (Archive Generators, RPM, DEB)
-cmake_minimum_required(VERSION 2.8.3 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.3.20101130 FATAL_ERROR)
project(CPackComponentsForAll)
# Create the mylib library
diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
index 6b471ca..b24ae5a 100644
--- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
+++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
@@ -13,7 +13,14 @@ endif(NOT CPackGen)
if(NOT CPackCommand)
message(FATAL_ERROR "CPackCommand not set")
endif(NOT CPackCommand)
+
+if(NOT CPackComponentWay)
+ message(FATAL_ERROR "CPackComponentWay not set")
+endif(NOT CPackComponentWay)
+
set(expected_file_mask "")
+# The usual default behavior is to expect a single file
+set(expected_count 1)
execute_process(COMMAND ${CPackCommand} -G ${CPackGen}
RESULT_VARIABLE result
@@ -23,10 +30,14 @@ execute_process(COMMAND ${CPackCommand} -G ${CPackGen}
if(CPackGen MATCHES "ZIP")
set(expected_file_mask "${CPackComponentsForAll_BINARY_DIR}/MyLib-*.zip")
- set(expected_count 2)
+ if (${CPackComponentWay} STREQUAL "default")
+ set(expected_count 1)
+ endif(${CPackComponentWay} STREQUAL "default")
endif(CPackGen MATCHES "ZIP")
-
+# Now verify if the number of expected file is OK
+# - using expected_file_mask and
+# - expected_count
if(expected_file_mask)
file(GLOB expected_file "${expected_file_mask}")
@@ -35,12 +46,12 @@ if(expected_file_mask)
message(STATUS "expected_file_mask='${expected_file_mask}'")
if(NOT expected_file)
- message(FATAL_ERROR "error: expected_file does not exist: CPackComponentsForAll test fails.")
+ message(FATAL_ERROR "error: expected_file=${expected_file} does not exist: CPackComponentsForAll test fails.")
endif(NOT expected_file)
list(LENGTH expected_file actual_count)
message(STATUS "actual_count='${actual_count}'")
if(NOT actual_count EQUAL expected_count)
- message(FATAL_ERROR "error: expected_count does not match actual_count: CPackComponents test fails.")
+ message(FATAL_ERROR "error: expected_count=${expected_count} does not match actual_count=${actual_count}: CPackComponents test fails.")
endif(NOT actual_count EQUAL expected_count)
endif(expected_file_mask)