diff options
author | Justin Goshi <jgoshi@microsoft.com> | 2019-09-11 18:37:48 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-09-18 18:00:39 (GMT) |
commit | 4d6334824d81086af205fe06b6fc4c4fda5224b4 (patch) | |
tree | 68fde8e73c4a899bc50dbd17ef5ae39423935c49 /Tests/RunCMake/FileAPI | |
parent | 5bd65dff7a8198279b1e592b7e48b91119dfc794 (diff) | |
download | CMake-4d6334824d81086af205fe06b6fc4c4fda5224b4.zip CMake-4d6334824d81086af205fe06b6fc4c4fda5224b4.tar.gz CMake-4d6334824d81086af205fe06b6fc4c4fda5224b4.tar.bz2 |
fileapi: add backtraces for LINK_PATH and LINK_DIRECTORIES
Diffstat (limited to 'Tests/RunCMake/FileAPI')
-rw-r--r-- | Tests/RunCMake/FileAPI/codemodel-v2-check.py | 40 | ||||
-rw-r--r-- | Tests/RunCMake/FileAPI/cxx/CMakeLists.txt | 1 |
2 files changed, 39 insertions, 2 deletions
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-check.py b/Tests/RunCMake/FileAPI/codemodel-v2-check.py index 2a24421..52934f2 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-check.py +++ b/Tests/RunCMake/FileAPI/codemodel-v2-check.py @@ -249,13 +249,13 @@ def check_target(c): if expected["backtrace"] is not None: expected_keys.append("backtrace") - assert actual["fragment"] == expected["fragment"] + assert matches(actual["fragment"], expected["fragment"]) assert actual["role"] == expected["role"] check_backtrace(obj, actual["backtrace"], expected["backtrace"]) assert sorted(actual.keys()) == sorted(expected_keys) - check_list_match(lambda a, e: is_string(a["fragment"], e["fragment"]), + check_list_match(lambda a, e: matches(a["fragment"], e["fragment"]), obj["link"]["commandFragments"], expected["link"]["commandFragments"], check=check_link_command_fragments, check_exception=lambda a, e: "Link fragment: %s" % a["fragment"], @@ -2218,6 +2218,42 @@ def gen_check_targets(c, g, inSource): }, ], }, + { + "fragment" : ".*TargetLinkDir\\\"?$", + "role" : "libraryPath", + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 19, + "command": "target_link_directories", + "hasParent": True, + }, + { + "file" : "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "fragment" : ".*cxx_lib.*", + "role" : "libraries", + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 6, + "command": "target_link_libraries", + "hasParent": True, + }, + { + "file" : "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, ], }, "archive": None, diff --git a/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt b/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt index 17ff455..b0564f5 100644 --- a/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt +++ b/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt @@ -16,3 +16,4 @@ target_link_libraries(cxx_static_exe PRIVATE cxx_static_lib) target_compile_options(cxx_exe PUBLIC TargetCompileOptions) target_link_options(cxx_exe PUBLIC TargetLinkOptions) +target_link_directories(cxx_exe PUBLIC "${CMAKE_BINARY_DIR}/TargetLinkDir") |