diff options
author | Brad King <brad.king@kitware.com> | 2022-12-12 22:59:41 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-12-17 13:52:04 (GMT) |
commit | d811d86fd7f9644876e9d3605937edffa5c8a9d8 (patch) | |
tree | 7359c796a0ec5bf273eedd924a2753980176cc8d /Tests/RunCMake/FileAPI | |
parent | 02599da236fd22db0dcfb6503194e5bad086aea9 (diff) | |
download | CMake-d811d86fd7f9644876e9d3605937edffa5c8a9d8.zip CMake-d811d86fd7f9644876e9d3605937edffa5c8a9d8.tar.gz CMake-d811d86fd7f9644876e9d3605937edffa5c8a9d8.tar.bz2 |
FileAPI: Add "configureLog" object kind
Provide clients with a way to get a known set of configure log event
versions.
Issue: #23200
Diffstat (limited to 'Tests/RunCMake/FileAPI')
9 files changed, 63 insertions, 0 deletions
diff --git a/Tests/RunCMake/FileAPI/RunCMakeTest.cmake b/Tests/RunCMake/FileAPI/RunCMakeTest.cmake index 961b73a..c768d18 100644 --- a/Tests/RunCMake/FileAPI/RunCMakeTest.cmake +++ b/Tests/RunCMake/FileAPI/RunCMakeTest.cmake @@ -65,6 +65,7 @@ function(run_object object) endfunction() run_object(codemodel-v2) +run_object(configureLog-v1) run_object(cache-v2) run_object(cmakeFiles-v1) run_object(toolchains-v1) diff --git a/Tests/RunCMake/FileAPI/configureLog-v1-ClientStateful-check.cmake b/Tests/RunCMake/FileAPI/configureLog-v1-ClientStateful-check.cmake new file mode 100644 index 0000000..bd4081c --- /dev/null +++ b/Tests/RunCMake/FileAPI/configureLog-v1-ClientStateful-check.cmake @@ -0,0 +1,11 @@ +set(expect + query + query/client-foo + query/client-foo/query.json + reply + reply/configureLog-v1-[0-9a-f]+.json + reply/index-[0-9.T-]+.json + ) +check_api("^${expect}$") + +check_python(configureLog-v1) diff --git a/Tests/RunCMake/FileAPI/configureLog-v1-ClientStateful-prep.cmake b/Tests/RunCMake/FileAPI/configureLog-v1-ClientStateful-prep.cmake new file mode 100644 index 0000000..c443487 --- /dev/null +++ b/Tests/RunCMake/FileAPI/configureLog-v1-ClientStateful-prep.cmake @@ -0,0 +1,4 @@ +file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/query.json" [[ + { "requests": [ { "kind": "configureLog", "version" : 1 } ] } +]]) diff --git a/Tests/RunCMake/FileAPI/configureLog-v1-ClientStateless-check.cmake b/Tests/RunCMake/FileAPI/configureLog-v1-ClientStateless-check.cmake new file mode 100644 index 0000000..7498dd5 --- /dev/null +++ b/Tests/RunCMake/FileAPI/configureLog-v1-ClientStateless-check.cmake @@ -0,0 +1,11 @@ +set(expect + query + query/client-foo + query/client-foo/configureLog-v1 + reply + reply/configureLog-v1-[0-9a-f]+.json + reply/index-[0-9.T-]+.json + ) +check_api("^${expect}$") + +check_python(configureLog-v1) diff --git a/Tests/RunCMake/FileAPI/configureLog-v1-ClientStateless-prep.cmake b/Tests/RunCMake/FileAPI/configureLog-v1-ClientStateless-prep.cmake new file mode 100644 index 0000000..ad49e08 --- /dev/null +++ b/Tests/RunCMake/FileAPI/configureLog-v1-ClientStateless-prep.cmake @@ -0,0 +1,2 @@ +file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/configureLog-v1" "") diff --git a/Tests/RunCMake/FileAPI/configureLog-v1-SharedStateless-check.cmake b/Tests/RunCMake/FileAPI/configureLog-v1-SharedStateless-check.cmake new file mode 100644 index 0000000..3e34be6 --- /dev/null +++ b/Tests/RunCMake/FileAPI/configureLog-v1-SharedStateless-check.cmake @@ -0,0 +1,10 @@ +set(expect + query + query/configureLog-v1 + reply + reply/configureLog-v1-[0-9a-f]+.json + reply/index-[0-9.T-]+.json + ) +check_api("^${expect}$") + +check_python(configureLog-v1) diff --git a/Tests/RunCMake/FileAPI/configureLog-v1-SharedStateless-prep.cmake b/Tests/RunCMake/FileAPI/configureLog-v1-SharedStateless-prep.cmake new file mode 100644 index 0000000..6fe0037 --- /dev/null +++ b/Tests/RunCMake/FileAPI/configureLog-v1-SharedStateless-prep.cmake @@ -0,0 +1,2 @@ +file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/configureLog-v1" "") diff --git a/Tests/RunCMake/FileAPI/configureLog-v1-check.py b/Tests/RunCMake/FileAPI/configureLog-v1-check.py new file mode 100644 index 0000000..ea5beb4 --- /dev/null +++ b/Tests/RunCMake/FileAPI/configureLog-v1-check.py @@ -0,0 +1,21 @@ +from check_index import * +import os + +def check_objects(o): + assert is_list(o) + assert len(o) == 1 + check_index_object(o[0], "configureLog", 1, 0, check_object_configureLog) + +def check_object_configureLog(o): + assert sorted(o.keys()) == ["eventKindNames", "kind", "path", "version"] + # The "kind" and "version" members are handled by check_index_object. + path = o["path"] + assert matches(path, "^.*/CMakeFiles/CMakeConfigureLog\\.yaml$") + assert os.path.exists(path) + eventKindNames = o["eventKindNames"] + assert is_list(eventKindNames) + assert sorted(eventKindNames) == ["try_compile-v1", "try_run-v1"] + +assert is_dict(index) +assert sorted(index.keys()) == ["cmake", "objects", "reply"] +check_objects(index["objects"]) diff --git a/Tests/RunCMake/FileAPI/configureLog-v1.cmake b/Tests/RunCMake/FileAPI/configureLog-v1.cmake new file mode 100644 index 0000000..c00af08 --- /dev/null +++ b/Tests/RunCMake/FileAPI/configureLog-v1.cmake @@ -0,0 +1 @@ +enable_language(C) |