diff options
Diffstat (limited to 'Tests/CMakeLists.txt')
-rw-r--r-- | Tests/CMakeLists.txt | 114 |
1 files changed, 93 insertions, 21 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 6b166d6..d78811d 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -2260,32 +2260,104 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release endif() if (CMake_TEST_GreenHillsMULTI) - macro(add_test_GhsMulti name primaryTarget bspName) - add_test(NAME GhsMulti.${name} COMMAND ${CMAKE_CTEST_COMMAND} - --build-and-test - "${CMake_SOURCE_DIR}/Tests/GhsMulti" - "${CMake_BINARY_DIR}/Tests/GhsMulti/${name}" - --build-generator "Green Hills MULTI" - --build-project ReturnNum - --build-config $<CONFIGURATION> - --build-options -DGHS_PRIMARY_TARGET=${primaryTarget} - -DGHS_BSP_NAME=${bspName} - ) - endmacro () - add_test_GhsMulti("arm_integrity_simarm" "arm_integrity.tgt" "simarm") - add_test_GhsMulti("arm64_integrity_simarm" "arm64_integrity.tgt" "simarm") - add_test(NAME GhsMulti.duplicate_source_filenames + 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}) + 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/GhsMultiDuplicateSourceFilenames" - "${CMake_BINARY_DIR}/Tests/GhsMultiDuplicateSourceFilenames" + "${CMake_SOURCE_DIR}/Tests/GhsMulti/${test_dir}" + "${CMake_BINARY_DIR}/Tests/GhsMulti/${ghs_config_name}/${test_dir}/${bin_sub_dir}" --build-generator "Green Hills MULTI" - --build-project ReturnNum + --build-project test --build-config $<CONFIGURATION> - --build-options -DGHS_PRIMARY_TARGET=arm_integrity.tgt - -DGHS_BSP_NAME="simarm" + --build-options ${ghs_target_arch} ${ghs_toolset_name} ${ghs_toolset_root} ${ghs_target_platform} + ${ghs_os_root} ${ghs_os_dir} ${ghs_bsp_name} ${_ghs_build_opts} ${_ghs_toolset_extra} + ${_ghs_test_command} ) - endif () + 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() + #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(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_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 "" "") + 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 "" "") + 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 "" "") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/GhsMulti/${ghs_config_name}") + #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) + endforeach() + endif() if(tegra AND NOT "${CMake_SOURCE_DIR};${CMake_BINARY_DIR}" MATCHES " ") macro(add_test_VSNsightTegra name generator) |