summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CPack/RPM
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/CPack/RPM')
-rw-r--r--Tests/RunCMake/CPack/RPM/RPM_DIST-ExpectedFiles.cmake5
-rw-r--r--Tests/RunCMake/CPack/RPM/RPM_DIST-VerifyResult.cmake11
2 files changed, 16 insertions, 0 deletions
diff --git a/Tests/RunCMake/CPack/RPM/RPM_DIST-ExpectedFiles.cmake b/Tests/RunCMake/CPack/RPM/RPM_DIST-ExpectedFiles.cmake
new file mode 100644
index 0000000..3b5a347
--- /dev/null
+++ b/Tests/RunCMake/CPack/RPM/RPM_DIST-ExpectedFiles.cmake
@@ -0,0 +1,5 @@
+set(whitespaces_ "[\t\n\r ]*")
+
+set(EXPECTED_FILES_COUNT "1")
+set(EXPECTED_FILE_1 "rpm_dist*.rpm")
+set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$")
diff --git a/Tests/RunCMake/CPack/RPM/RPM_DIST-VerifyResult.cmake b/Tests/RunCMake/CPack/RPM/RPM_DIST-VerifyResult.cmake
new file mode 100644
index 0000000..7375ecc
--- /dev/null
+++ b/Tests/RunCMake/CPack/RPM/RPM_DIST-VerifyResult.cmake
@@ -0,0 +1,11 @@
+execute_process(COMMAND ${RPMBUILD_EXECUTABLE} -E %{?dist}
+ OUTPUT_VARIABLE DIST_TAG
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+set(whitespaces_ "[\t\n\r ]*")
+
+getPackageInfo("${FOUND_FILE_1}" "FILE_INFO_")
+if(NOT FILE_INFO_ MATCHES ".*Release${whitespaces_}:${whitespaces_}1${DIST_TAG}")
+ message(FATAL_ERROR "Unexpected Release in '${FOUND_FILE_1}'; file info: '${FILE_INFO_}'")
+endif()