diff options
author | Fred Baksik <fdk17@ftml.net> | 2022-03-16 20:25:25 (GMT) |
---|---|---|
committer | Fred Baksik <fdk17@ftml.net> | 2022-03-17 23:11:48 (GMT) |
commit | 829e946c69aacecb9b56b9522bd357db316fea4a (patch) | |
tree | d6cf5e1421bde0f570a22a35dbae1a4780267f35 /Tests/GhsMulti | |
parent | 93c1acd8ffdd59e127b11a47e13bf058d9cfe43c (diff) | |
download | CMake-829e946c69aacecb9b56b9522bd357db316fea4a.zip CMake-829e946c69aacecb9b56b9522bd357db316fea4a.tar.gz CMake-829e946c69aacecb9b56b9522bd357db316fea4a.tar.bz2 |
GHS: Update tests for updated binary layout
The tests need to look for the items in the correct locations.
Diffstat (limited to 'Tests/GhsMulti')
-rw-r--r-- | Tests/GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt | 15 | ||||
-rw-r--r-- | Tests/GhsMulti/GhsMultiExclude/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/GhsMulti/GhsMultiExclude/verify.cmake | 104 | ||||
-rw-r--r-- | Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt | 15 | ||||
-rw-r--r-- | Tests/GhsMulti/GhsMultiMultipleProjects/verify.cmake | 90 |
5 files changed, 104 insertions, 122 deletions
diff --git a/Tests/GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt b/Tests/GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt index 4a3f5c2..9250709 100644 --- a/Tests/GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt +++ b/Tests/GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt @@ -27,8 +27,7 @@ try_compile(RESULT message("Output from build:\n${OUTPUT}") if (RUN_TEST STREQUAL "RELEASE_FLAGS") find_file (fileName test_none.gpj - ${CMAKE_CURRENT_BINARY_DIR}/build - ${CMAKE_CURRENT_BINARY_DIR}/build/test_none + ${CMAKE_CURRENT_BINARY_DIR}/build/test_none.dir ) message("Parsing project file: ${fileName}") file(STRINGS ${fileName} fileText) @@ -40,8 +39,7 @@ if (RUN_TEST STREQUAL "RELEASE_FLAGS") else() unset(fileName CACHE) find_file (fileName K1.gpj - ${CMAKE_CURRENT_BINARY_DIR}/build - ${CMAKE_CURRENT_BINARY_DIR}/build/K1 + ${CMAKE_CURRENT_BINARY_DIR}/build/K1.dir ) message("Parsing project file: ${fileName}") file(STRINGS ${fileName} fileText) @@ -53,8 +51,7 @@ else() unset(fileName CACHE) find_file (fileName K2.gpj - ${CMAKE_CURRENT_BINARY_DIR}/build - ${CMAKE_CURRENT_BINARY_DIR}/build/K2 + ${CMAKE_CURRENT_BINARY_DIR}/build/K2.dir ) message("Parsing project file: ${fileName}") file(STRINGS ${fileName} fileText) @@ -66,8 +63,7 @@ else() unset(fileName CACHE) find_file (fileName K3.gpj - ${CMAKE_CURRENT_BINARY_DIR}/build - ${CMAKE_CURRENT_BINARY_DIR}/build/K3 + ${CMAKE_CURRENT_BINARY_DIR}/build/K3.dir ) message("Parsing project file: ${fileName}") file(STRINGS ${fileName} fileText) @@ -79,8 +75,7 @@ else() unset(fileName CACHE) find_file (fileName K4.gpj - ${CMAKE_CURRENT_BINARY_DIR}/build - ${CMAKE_CURRENT_BINARY_DIR}/build/K4 + ${CMAKE_CURRENT_BINARY_DIR}/build/K4.dir ) message("Parsing project file: ${fileName}") file(STRINGS ${fileName} fileText) diff --git a/Tests/GhsMulti/GhsMultiExclude/CMakeLists.txt b/Tests/GhsMulti/GhsMultiExclude/CMakeLists.txt index 0448cf2..575bf50 100644 --- a/Tests/GhsMulti/GhsMultiExclude/CMakeLists.txt +++ b/Tests/GhsMulti/GhsMultiExclude/CMakeLists.txt @@ -14,4 +14,6 @@ set_target_properties( lib1 PROPERTIES EXCLUDE_FROM_ALL yes ) add_library(lib2 EXCLUDE_FROM_ALL lib1.c) +add_library(lib3 lib1.c) + add_executable(exe1 exe1.c) diff --git a/Tests/GhsMulti/GhsMultiExclude/verify.cmake b/Tests/GhsMulti/GhsMultiExclude/verify.cmake index 0467b5a..99cef63 100644 --- a/Tests/GhsMulti/GhsMultiExclude/verify.cmake +++ b/Tests/GhsMulti/GhsMultiExclude/verify.cmake @@ -1,54 +1,56 @@ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. -#test project was generated -unset(fileName CACHE) -find_file (fileName lib1.gpj - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_BINARY_DIR}/lib1 - ) - -if (fileName) - message("Found target lib1: ${fileName}") -else() - message(SEND_ERROR "Could not find target lib1: ${fileName}") -endif() - -#test project was built -unset(fileName CACHE) -find_file (fileName lib1.a - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_BINARY_DIR}/lib1 - ) - -if (fileName) - message(SEND_ERROR "Found target lib1: ${fileName}") -else() - message("Could not find target lib1: ${fileName}") -endif() - -#test project was generated -unset(fileName CACHE) -find_file (fileName lib2.gpj - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_BINARY_DIR}/lib2 - ) - -if (fileName) - message("Found target lib2 ${fileName}") -else() - message(SEND_ERROR "Could not find target lib2: ${fileName}") -endif() - -#test project was built -unset(fileName CACHE) -find_file (fileName lib2.a - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_BINARY_DIR}/lib2 - ) - -if (fileName) - message(SEND_ERROR "Found target lib2: ${fileName}") -else() - message("Could not find target lib2: ${fileName}") -endif() +function(verify_skipped_tgt name) + unset(fileName CACHE) + find_file (fileName ${name}.tgt.gpj + ${CMAKE_CURRENT_BINARY_DIR} + ) + + if (fileName) + message("Found target ${name}: ${fileName}") + else() + message(SEND_ERROR "Could not find target ${name}: ${fileName}") + endif() + + #test project was built + unset(fileName CACHE) + find_file (fileName lib${name}.a + ${CMAKE_CURRENT_BINARY_DIR} + ) + + if (fileName) + message(SEND_ERROR "Found target ${name}: ${fileName}") + else() + message("Could not find target ${name}: ${fileName}") + endif() +endfunction() + +function(locate_tgt name) + unset(fileName CACHE) + find_file (fileName ${name}.tgt.gpj + ${CMAKE_CURRENT_BINARY_DIR} + ) + + if (fileName) + message("Found target ${name}: ${fileName}") + else() + message(SEND_ERROR "Could not find target ${name}: ${fileName}") + endif() + + #test project was built + unset(fileName CACHE) + find_file (fileName lib${name}.a + ${CMAKE_CURRENT_BINARY_DIR} + ) + + if (fileName) + message( "Found target ${name}: ${fileName}") + else() + message(SEND_ERROR "Could not find target ${name}: ${fileName}") + endif() +endfunction() + +verify_skipped_tgt(lib1) +verify_skipped_tgt(lib2) +locate_tgt(lib3) diff --git a/Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt b/Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt index da80b51..2d21bfb 100644 --- a/Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt +++ b/Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt @@ -38,8 +38,7 @@ if (RUN_TEST STREQUAL "NO_FLAGS") else() unset(fileName CACHE) find_file(fileName exe1.gpj - ${CMAKE_CURRENT_BINARY_DIR}/link_build - ${CMAKE_CURRENT_BINARY_DIR}/link_build/exe1 + ${CMAKE_CURRENT_BINARY_DIR}/link_build/exe1.dir ) message("Parsing project file: ${fileName}") file(STRINGS ${fileName} fileText) @@ -54,13 +53,14 @@ else() string(FIND "${fileText}" "${opt}" opt_found) if ( opt_found EQUAL -1 ) message(SEND_ERROR "Could not find: ${opt}") + else() + message("located: ${opt}") endif() endforeach() unset(fileName CACHE) find_file (fileName lib1.gpj - ${CMAKE_CURRENT_BINARY_DIR}/link_build - ${CMAKE_CURRENT_BINARY_DIR}/link_build/lib1 + ${CMAKE_CURRENT_BINARY_DIR}/link_build/lib1.dir ) message("Parsing project file: ${fileName}") file(STRINGS ${fileName} fileText) @@ -71,13 +71,14 @@ else() string(FIND "${fileText}" "${opt}" opt_found) if (opt_found EQUAL -1) message(SEND_ERROR "Could not find: ${opt}") + else() + message("located: ${opt}") endif() endforeach() unset(fileName CACHE) find_file (fileName lib2.gpj - ${CMAKE_CURRENT_BINARY_DIR}/link_build - ${CMAKE_CURRENT_BINARY_DIR}/link_build/lib2 + ${CMAKE_CURRENT_BINARY_DIR}/link_build/lib2.dir ) message("Parsing project file: ${fileName}") file(STRINGS ${fileName} fileText) @@ -87,6 +88,8 @@ else() string(FIND "${fileText}" "${opt}" opt_found) if ( opt_found EQUAL -1 ) message(SEND_ERROR "Could not find: ${opt}") + else() + message("located: ${opt}") endif() endforeach() endif() diff --git a/Tests/GhsMulti/GhsMultiMultipleProjects/verify.cmake b/Tests/GhsMulti/GhsMultiMultipleProjects/verify.cmake index 3855215..b6af935 100644 --- a/Tests/GhsMulti/GhsMultiMultipleProjects/verify.cmake +++ b/Tests/GhsMulti/GhsMultiMultipleProjects/verify.cmake @@ -1,58 +1,38 @@ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. -#test project was generated -unset(fileName CACHE) -find_file(fileName lib3.gpj - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_BINARY_DIR}/lib3 - ${CMAKE_CURRENT_BINARY_DIR}/examples - ) - -if (fileName) - message("Found target lib3: ${fileName}") -else() - message(SEND_ERROR "Could not find target lib3: ${fileName}") -endif() - -#test project was generated -unset(fileName CACHE) -find_file (fileName exe3.gpj - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_BINARY_DIR}/exe3 - ${CMAKE_CURRENT_BINARY_DIR}/examples - ) - -if (fileName) - message("Found target exe3: ${fileName}") -else() - message(SEND_ERROR "Could not find target exe3: ${fileName}") -endif() - -#test project was not built -unset(fileName CACHE) -find_file (fileName lib3.a - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_BINARY_DIR}/lib3 - ${CMAKE_CURRENT_BINARY_DIR}/examples - ) - -if (fileName) - message(SEND_ERROR "Found target lib3: ${fileName}") -else() - message("Could not find target lib3: ${fileName}") -endif() - -unset(fileName CACHE) -find_file (fileName NAMES exe3.as exe3 - HINTS - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_BINARY_DIR}/exe3 - ${CMAKE_CURRENT_BINARY_DIR}/examples - ) - -if (fileName) - message(SEND_ERROR "Found target exe3: ${fileName}") -else() - message("Could not find target exe3: ${fileName}") -endif() +function(verify_project_top name) + unset(fileName CACHE) + find_file (fileName ${name}.top.gpj + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR}/sub + ${CMAKE_CURRENT_BINARY_DIR}/examples + ) + + if (fileName) + message("Found target ${name}: ${fileName}") + else() + message(SEND_ERROR "Could not find project ${name}: ${fileName}") + endif() +endfunction() + +function(verify_exe_built name) + unset(fileName CACHE) + find_file (fileName ${name} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR}/sub + ) + + if (fileName) + message("Found target ${name}: ${fileName}") + else() + message(SEND_ERROR "Could not find project ${name}: ${fileName}") + endif() +endfunction() + +#test project top files were generated +verify_project_top(test) +verify_project_top(test2) +verify_project_top(test3) +verify_exe_built(exe1) +verify_exe_built(exe2) |