Commit 5f61ed99 authored by Domen Vrankar's avatar Domen Vrankar Committed by Brad King
Browse files

Tests: Move RunCMake.CPackRPM case into RunCMake.CPack_RPM test

Move PARTIALLY_RELOCATABLE_WARNING test to the new common CPack test
script structure to have all tests in one place as well as additional
benefit of having some more checks done during test execution.
parent e726fc02
......@@ -239,10 +239,6 @@ add_RunCMake_test(IfacePaths_INCLUDE_DIRECTORIES TEST_DIR IfacePaths)
set(IfacePaths_SOURCES_ARGS -DTEST_PROP=SOURCES)
add_RunCMake_test(IfacePaths_SOURCES TEST_DIR IfacePaths)
if(RPMBUILD_EXECUTABLE)
add_RunCMake_test(CPackRPM)
endif()
add_RunCMake_test(COMPILE_LANGUAGE-genex)
# Matlab module related tests
......
set(whitespaces_ "[\t\n\r ]*")
set(EXPECTED_FILES_COUNT "1")
set(EXPECTED_FILE_1 "PARTIALLY_RELOCATABLE_WARNING-0.1.1-*.rpm")
set(EXPECTED_FILE_CONTENT_1 "^/not_relocatable${whitespaces_}/not_relocatable/CMakeLists.txt${whitespaces_}/opt$")
......@@ -5,3 +5,4 @@ include("${RunCMake_SOURCE_DIR}/CPackTestHelpers.cmake")
# args: TEST_NAME "GENERATORS" RUN_CMAKE_BUILD_STEP
run_cpack_test(MINIMAL "RPM;DEB" false)
run_cpack_test(PARTIALLY_RELOCATABLE_WARNING "RPM" false)
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
set(CPACK_GENERATOR "RPM")
include(CPack)
include(RunCMake)
function(run_cpack_rpm_test TEST_NAME)
set(RunCMake_TEST_NO_CLEAN TRUE)
set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/${TEST_NAME}-build")
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
execute_process(
COMMAND "${CMAKE_COMMAND}" -D RunCMake_TEST=${TEST_NAME} "${RunCMake_SOURCE_DIR}"
WORKING_DIRECTORY "${RunCMake_TEST_BINARY_DIR}"
OUTPUT_QUIET
ERROR_QUIET
)
run_cmake_command(${TEST_NAME} ${CMAKE_CPACK_COMMAND})
endfunction()
run_cpack_rpm_test(CPackRPM_PARTIALLY_RELOCATABLE_WARNING)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment