diff options
Diffstat (limited to 'Tests/RunCMake')
6 files changed, 43 insertions, 7 deletions
diff --git a/Tests/RunCMake/CommandLine/ProfilingTest-check.cmake b/Tests/RunCMake/CommandLine/ProfilingTest-check.cmake index 19ece86..2e8eac1 100644 --- a/Tests/RunCMake/CommandLine/ProfilingTest-check.cmake +++ b/Tests/RunCMake/CommandLine/ProfilingTest-check.cmake @@ -16,3 +16,16 @@ if (NOT JSON_TRAILER MATCHES "^}]$") set(RunCMake_TEST_FAILED "Expected valid JSON end") return() endif() + +file(STRINGS ${ProfilingTestOutput} upperCaseCommand + REGEX [["name"[ ]*:[ ]*"__TESTING_COMMAND_CASE"]]) +if (NOT "${upperCaseCommand}" STREQUAL "") + set(RunCMake_TEST_FAILED "Command name not stored in lowercase") +endif() +file(STRINGS ${ProfilingTestOutput} lowerCaseCommand + REGEX [["name"[ ]*:[ ]*"__testing_command_case"]]) +list(LENGTH lowerCaseCommand numInvocations) +if (NOT numInvocations EQUAL 1) + set(RunCMake_TEST_FAILED + "Unexpected number of lowercase command names: ${numInvocations}") +endif() diff --git a/Tests/RunCMake/CommandLine/ProfilingTest.cmake b/Tests/RunCMake/CommandLine/ProfilingTest.cmake index 837f4bf..4cf0c30 100644 --- a/Tests/RunCMake/CommandLine/ProfilingTest.cmake +++ b/Tests/RunCMake/CommandLine/ProfilingTest.cmake @@ -1 +1,5 @@ -# This file is intentionally left blank +function(__testing_command_case) +endfunction() + +# This must not appear in the profiling output as uppercase +__TESTING_COMMAND_CASE() diff --git a/Tests/RunCMake/alias_targets/get_property-subdir/CMakeLists.txt b/Tests/RunCMake/alias_targets/get_property-subdir/CMakeLists.txt index bfd9840..b114b75 100644 --- a/Tests/RunCMake/alias_targets/get_property-subdir/CMakeLists.txt +++ b/Tests/RunCMake/alias_targets/get_property-subdir/CMakeLists.txt @@ -6,3 +6,10 @@ check_property (alias::import-local-subdir ALIASED_TARGET "import-local") check_property (alias::import-local-subdir IMPORTED "TRUE") check_property (alias::import-local-subdir ALIAS_GLOBAL "FALSE") check_property (alias::import-local-subdir IMPORT_LOCAL_PROPERTY "IMPORT_LOCAL") + + +# non-global alias defined in parent directory must be visible in sub-directory +check_property (alias::import-local ALIASED_TARGET "import-local") +check_property (alias::import-local IMPORTED "TRUE") +check_property (alias::import-local ALIAS_GLOBAL "FALSE") +check_property (alias::import-local IMPORT_LOCAL_PROPERTY "IMPORT_LOCAL") diff --git a/Tests/RunCMake/target_link_libraries-ALIAS/AliasTargets.cmake b/Tests/RunCMake/target_link_libraries-ALIAS/AliasTargets.cmake index 73f8a7d..316b74b 100644 --- a/Tests/RunCMake/target_link_libraries-ALIAS/AliasTargets.cmake +++ b/Tests/RunCMake/target_link_libraries-ALIAS/AliasTargets.cmake @@ -15,22 +15,25 @@ endif() add_library(import-local SHARED IMPORTED) set_property(TARGET import-local PROPERTY IMPORTED_LOCATION "${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}func${CMAKE_SHARED_LIBRARY_SUFFIX}") set_property(TARGET import-local PROPERTY IMPORTED_IMPLIB "${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}func${CMAKE_IMPORT_LIBRARY_SUFFIX}") -add_library(alias-local ALIAS import-local) +add_library(alias::local ALIAS import-local) add_library (lib-local SHARED lib.c) -target_link_libraries (lib-local PRIVATE import-local) +target_link_libraries (lib-local PRIVATE alias::local) add_executable (main-local main.c) -target_link_libraries (main-local PRIVATE import-local) +target_link_libraries (main-local PRIVATE alias::local) add_library(import-global SHARED IMPORTED GLOBAL) set_property(TARGET import-global PROPERTY IMPORTED_LOCATION "${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}func${CMAKE_SHARED_LIBRARY_SUFFIX}") set_property(TARGET import-global PROPERTY IMPORTED_IMPLIB "${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}func${CMAKE_IMPORT_LIBRARY_SUFFIX}") -add_library(alias-global ALIAS import-global) +add_library(alias::global ALIAS import-global) add_library (lib-global SHARED lib.c) -target_link_libraries (lib-global PRIVATE import-global) +target_link_libraries (lib-global PRIVATE alias::global) add_executable (main-global main.c) -target_link_libraries (main-global PRIVATE import-global) +target_link_libraries (main-global PRIVATE alias::global) + + +add_subdirectory(sub_dir) diff --git a/Tests/RunCMake/target_link_libraries-ALIAS/RunCMakeTest.cmake b/Tests/RunCMake/target_link_libraries-ALIAS/RunCMakeTest.cmake index 4d24a6e..42ec47e 100644 --- a/Tests/RunCMake/target_link_libraries-ALIAS/RunCMakeTest.cmake +++ b/Tests/RunCMake/target_link_libraries-ALIAS/RunCMakeTest.cmake @@ -19,5 +19,7 @@ run_cmake_target(AliasTargets lib-local lib-local --config Release) run_cmake_target(AliasTargets main-local main-local --config Release) run_cmake_target(AliasTargets lib-global lib-global --config Release) run_cmake_target(AliasTargets main-global main-global --config Release) +run_cmake_target(AliasTargets lib-sub lib-sub --config Release) +run_cmake_target(AliasTargets main-sub main-sub --config Release) unset(RunCMake_TEST_OPTIONS) unset(RunCMake_TEST_OUTPUT_MERGE) diff --git a/Tests/RunCMake/target_link_libraries-ALIAS/sub_dir/CMakeLists.txt b/Tests/RunCMake/target_link_libraries-ALIAS/sub_dir/CMakeLists.txt new file mode 100644 index 0000000..326e964 --- /dev/null +++ b/Tests/RunCMake/target_link_libraries-ALIAS/sub_dir/CMakeLists.txt @@ -0,0 +1,7 @@ + + +add_library (lib-sub SHARED ../lib.c) +target_link_libraries (lib-sub PRIVATE alias::local) + +add_executable (main-sub ../main.c) +target_link_libraries (main-sub PRIVATE alias::local) |