summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-03-21 18:36:35 +0000
committerKitware Robot <kwrobot@kitware.com>2022-03-21 14:36:42 -0400
commit7e642a6fa0884cf683a1a50dd5cab93acd1e3950 (patch)
treedfd5a6fc58afdb02c0f68d9cbc395c8ad48971b2 /Tests
parenta4b04e62fc44f36982308e9d3be6611b5f9cd4ce (diff)
parent399e73b89a5e339e812cf4b02e63c45e18bcd49a (diff)
downloadcmake-7e642a6fa0884cf683a1a50dd5cab93acd1e3950.tar.gz
Merge topic 'ghs_predefined_targets'
399e73b89a GHS: release note 829e946c69 GHS: Update tests for updated binary layout 93c1acd8ff GHS: List predefined targets before user targets in GUI bdb213819c GHS: Do not include WindowsPaths b3e9c72901 GHS: use INSTALL target a645287784 GHS: update build command 724b5491ef GHS: Rearrange project files in binary directory edff0f6a1d GHS: Use Custom Target for ALL_BUILD ... Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7079
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLists.txt2
-rw-r--r--Tests/GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt15
-rw-r--r--Tests/GhsMulti/GhsMultiExclude/CMakeLists.txt2
-rw-r--r--Tests/GhsMulti/GhsMultiExclude/verify.cmake104
-rw-r--r--Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt15
-rw-r--r--Tests/GhsMulti/GhsMultiMultipleProjects/verify.cmake90
6 files changed, 105 insertions, 123 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 9ac42a6c7b..e39cdaf902 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -2319,7 +2319,7 @@ if(BUILD_TESTING)
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} --build . --target install)
+ "-DCMAKE_INSTALL_PREFIX=. -DRUN_TEST=${test_name}" ${CMAKE_CMAKE_COMMAND} --build . --target INSTALL)
endmacro()
#unset ghs config variables
unset(ghs_config_name)
diff --git a/Tests/GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt b/Tests/GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt
index 4a3f5c2381..925070917b 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 0448cf2d67..575bf50e44 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 0467b5a0d2..99cef63b49 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 da80b510f6..2d21bfbc9a 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 3855215afb..b6af935dc6 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)