summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeLists.txt
diff options
context:
space:
mode:
authorFred Baksik <frodak17@gmail.com>2019-01-09 04:52:12 (GMT)
committerFred Baksik <frodak17@gmail.com>2019-01-16 15:42:08 (GMT)
commit21ab58d3f8782e80145f14eb6e72926c9d17afc6 (patch)
tree04b73d0d54cc854bedc8641aa5b7f73677362088 /Tests/CMakeLists.txt
parent72e0c115b771fe9e3f4b5a5b6bd3bcdade77a7cb (diff)
downloadCMake-21ab58d3f8782e80145f14eb6e72926c9d17afc6.zip
CMake-21ab58d3f8782e80145f14eb6e72926c9d17afc6.tar.gz
CMake-21ab58d3f8782e80145f14eb6e72926c9d17afc6.tar.bz2
GHS: Update test suite
-- Allow for testing default toolset settings If CMake_TEST_GreenHillsMULTI_config is not defined then just run the GHS tests using defaults. -- Handle paths that contain spaces -- Update test suite to use "-non_shared" linker option Fixes linking issue if GHS is not shipped with shared libraries -- Other minor cleanup
Diffstat (limited to 'Tests/CMakeLists.txt')
-rw-r--r--Tests/CMakeLists.txt103
1 files changed, 65 insertions, 38 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 87bd27e..d78811d 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -2260,11 +2260,18 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
endif()
if (CMake_TEST_GreenHillsMULTI)
- macro(add_test_GhsMulti test_name test_dir bin_sub_dir build_opts test_cmd)
- separate_arguments(_build_opts UNIX_COMMAND ${build_opts})
- separate_arguments(_test_cmd UNIX_COMMAND ${test_cmd})
+ macro(add_test_GhsMulti test_name test_dir bin_sub_dir build_opts)
+ separate_arguments(_ghs_build_opts UNIX_COMMAND ${build_opts})
separate_arguments(_ghs_toolset_extra UNIX_COMMAND ${ghs_toolset_extra})
- add_test(NAME GhsMulti.${ghs_config_name}.${test_name}
+ if(${ARGC} GREATER 4)
+ set(_ghs_test_command --test-command ${ARGN})
+ endif()
+ if(ghs_config_name STREQUAL "__default__")
+ set(_ghs_test_name "${test_name}")
+ else()
+ set(_ghs_test_name "${ghs_config_name}.${test_name}")
+ endif()
+ add_test(NAME GhsMulti.${_ghs_test_name}
COMMAND ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/GhsMulti/${test_dir}"
@@ -2273,51 +2280,71 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
--build-project test
--build-config $<CONFIGURATION>
--build-options ${ghs_target_arch} ${ghs_toolset_name} ${ghs_toolset_root} ${ghs_target_platform}
- ${ghs_os_root} ${ghs_os_dir} ${ghs_bsp_name} ${_build_opts} ${_ghs_toolset_extra}
- --test-command ${_test_cmd}
+ ${ghs_os_root} ${ghs_os_dir} ${ghs_bsp_name} ${_ghs_build_opts} ${_ghs_toolset_extra}
+ ${_ghs_test_command}
)
- endmacro ()
+ unset(_ghs_build_opts)
+ unset(_ghs_toolset_extra)
+ unset(_ghs_test_command)
+ unset(_ghs_test_name)
+ endmacro()
macro(add_test_GhsMulti_rename_install test_name)
add_test_GhsMulti( ${test_name} GhsMultiRenameInstall ${test_name}
- "-DCMAKE_INSTALL_PREFIX=. -DRUN_TEST=${test_name}" "${CMAKE_CMAKE_COMMAND} -P ./cmake_install.cmake")
- endmacro ()
+ "-DCMAKE_INSTALL_PREFIX=. -DRUN_TEST=${test_name}" ${CMAKE_CMAKE_COMMAND} -P ./cmake_install.cmake)
+ endmacro()
+ #unset ghs config variables
+ unset(ghs_config_name)
+ unset(ghs_target_arch)
+ unset(ghs_toolset_root)
+ unset(ghs_toolset_name)
+ unset(ghs_os_root)
+ unset(ghs_os_dir)
+ unset(ghs_target_platform)
+ unset(ghs_bsp_name)
+ unset(ghs_toolset_extra)
+ if(NOT CMake_TEST_GreenHillsMULTI_config)
+ #if list of config settings not defined then just run once as default
+ set(CMake_TEST_GreenHillsMULTI_config "__default__")
+ endif()
foreach(ghs_file IN LISTS CMake_TEST_GreenHillsMULTI_config)
# source GHS tools config file
- if(IS_ABSOLUTE ${ghs_file})
- include(${ghs_file})
- else()
- include(${CMAKE_BINARY_DIR}/${ghs_file})
+ if(NOT ghs_file STREQUAL "__default__")
+ if(IS_ABSOLUTE ${ghs_file})
+ include(${ghs_file})
+ else()
+ include(${CMAKE_BINARY_DIR}/${ghs_file})
+ endif()
+ endif()
+ if(NOT ghs_config_name)
+ set(ghs_config_name "__default__")
endif()
# test integrity build
if (NOT ghs_skip_integrity AND (NOT ghs_target_platform OR ghs_target_platform MATCHES "integrity"))
- add_test_GhsMulti(integrityDDInt GhsMultiIntegrity/GhsMultiIntegrityDDInt "" "" "")
- add_test_GhsMulti(integrityMonolith GhsMultiIntegrity/GhsMultiIntegrityMonolith "" "" "")
- add_test_GhsMulti(integrityDD GhsMultiIntegrity/GhsMultiIntegrityDD "" "" "")
- endif ()
- add_test_GhsMulti(duplicate_source_filenames GhsMultiDuplicateSourceFilenames "" "" "")
+ add_test_GhsMulti(integrityDDInt GhsMultiIntegrity/GhsMultiIntegrityDDInt "" "")
+ add_test_GhsMulti(integrityMonolith GhsMultiIntegrity/GhsMultiIntegrityMonolith "" "")
+ add_test_GhsMulti(integrityDD GhsMultiIntegrity/GhsMultiIntegrityDD "" "")
+ endif()
+ add_test_GhsMulti(duplicate_source_filenames GhsMultiDuplicateSourceFilenames "" "")
add_test_GhsMulti_rename_install(SINGLE_EXEC)
add_test_GhsMulti_rename_install(SINGLE_EXEC_RENAMED)
add_test_GhsMulti_rename_install(EXEC_AND_LIB)
- add_test_GhsMulti(multiple_source_groups GhsMultiSrcGroups Default "" "")
- add_test_GhsMulti(multiple_source_groups_folders GhsMultiSrcGroups PropFolders "-DTEST_PROP=ON" "")
- add_test_GhsMulti(multiple_source_groups_all_folders GhsMultiSrcGroups AllFolders "-DGHS_NO_SOURCE_GROUP_FILE=ON" "")
- add_test_GhsMulti(unsupported_targets GhsMultiUnsupportedTargets "" "" "")
- set_tests_properties(GhsMulti.${ghs_config_name}.unsupported_targets PROPERTIES TIMEOUT 15)
- add_test_GhsMulti(object_library GhsMultiObjectLibrary "" "" "")
- set_tests_properties(GhsMulti.${ghs_config_name}.object_library PROPERTIES TIMEOUT 15)
+ add_test_GhsMulti(multiple_source_groups GhsMultiSrcGroups Default "")
+ add_test_GhsMulti(multiple_source_groups_folders GhsMultiSrcGroups PropFolders "-DTEST_PROP=ON")
+ add_test_GhsMulti(multiple_source_groups_all_folders GhsMultiSrcGroups AllFolders "-DGHS_NO_SOURCE_GROUP_FILE=ON")
+ add_test_GhsMulti(unsupported_targets GhsMultiUnsupportedTargets "" "")
+ add_test_GhsMulti(object_library GhsMultiObjectLibrary "" "")
add_test_GhsMulti(exclude GhsMultiExclude "" ""
- "${CMAKE_CMAKE_COMMAND} -P ${CMake_SOURCE_DIR}/Tests/GhsMulti/GhsMultiExclude/verify.cmake")
- add_test_GhsMulti(interface GhsMultiInterface "" "" "")
- set_tests_properties(GhsMulti.${ghs_config_name}.interface PROPERTIES TIMEOUT 15)
- add_test_GhsMulti(transitive_link_test GhsMultiLinkTest TransitiveLink "-DRUN_TEST=NO_FLAGS" "")
- add_test_GhsMulti(flags_link_test GhsMultiLinkTest FlagsCheck "-DRUN_TEST=CHECK_FLAGS" "")
- add_test_GhsMulti(sub_link_test GhsMultiLinkTestSub "" "" "")
+ ${CMAKE_CMAKE_COMMAND} -P ${CMake_SOURCE_DIR}/Tests/GhsMulti/GhsMultiExclude/verify.cmake)
+ add_test_GhsMulti(interface GhsMultiInterface "" "")
+ add_test_GhsMulti(transitive_link_test GhsMultiLinkTest TransitiveLink "-DRUN_TEST=NO_FLAGS")
+ add_test_GhsMulti(flags_link_test GhsMultiLinkTest FlagsCheck "-DRUN_TEST=CHECK_FLAGS")
+ add_test_GhsMulti(sub_link_test GhsMultiLinkTestSub "" "")
add_test_GhsMulti(multiple_projects GhsMultiMultipleProjects "" ""
- "${CMAKE_CMAKE_COMMAND} -P ${CMake_SOURCE_DIR}/Tests/GhsMulti/GhsMultiMultipleProjects/verify.cmake")
- add_test_GhsMulti(compiler_options_none GhsMultiCompilerOptions None "-DRUN_TEST=RELEASE_FLAGS -DRUN_TEST_BUILD_TYPE=\"\"" "")
- add_test_GhsMulti(compiler_options_kernel GhsMultiCompilerOptions Kernel "-DRUN_TEST=KERNEL_FLAGS -DRUN_TEST_BUILD_TYPE=DEBUG" "")
- add_test_GhsMulti(try_compile_copy GhsMultiCopyFile "" "" "")
- add_test_GhsMulti(ghs_platform GhsMultiPlatform "" "" "")
+ ${CMAKE_CMAKE_COMMAND} -P ${CMake_SOURCE_DIR}/Tests/GhsMulti/GhsMultiMultipleProjects/verify.cmake)
+ add_test_GhsMulti(compiler_options_none GhsMultiCompilerOptions None "-DRUN_TEST=RELEASE_FLAGS -DRUN_TEST_BUILD_TYPE=\"\"")
+ add_test_GhsMulti(compiler_options_kernel GhsMultiCompilerOptions Kernel "-DRUN_TEST=KERNEL_FLAGS -DRUN_TEST_BUILD_TYPE=DEBUG")
+ add_test_GhsMulti(try_compile_copy GhsMultiCopyFile "" "")
+ add_test_GhsMulti(ghs_platform GhsMultiPlatform "" "")
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/GhsMulti/${ghs_config_name}")
#unset ghs config variables
unset(ghs_config_name)
@@ -2329,8 +2356,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
unset(ghs_target_platform)
unset(ghs_bsp_name)
unset(ghs_toolset_extra)
- endforeach(ghs_file)
- endif ()
+ endforeach()
+ endif()
if(tegra AND NOT "${CMake_SOURCE_DIR};${CMake_BINARY_DIR}" MATCHES " ")
macro(add_test_VSNsightTegra name generator)