diff options
author | Brad King <brad.king@kitware.com> | 2018-11-01 13:37:17 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-12-12 14:46:13 (GMT) |
commit | 7489e95b8ec35c7faa1f9dcfc3a6962a56969531 (patch) | |
tree | 6c14a990c888995e4e696cc8d63780ca89ca80ca /Tests/RunCMake/FileAPI | |
parent | ea0a0601682af00706cf57f6d3e27d4f0895ecbb (diff) | |
download | CMake-7489e95b8ec35c7faa1f9dcfc3a6962a56969531.zip CMake-7489e95b8ec35c7faa1f9dcfc3a6962a56969531.tar.gz CMake-7489e95b8ec35c7faa1f9dcfc3a6962a56969531.tar.bz2 |
fileapi: add cache v2
Start with v2 to distinguish it from server-mode v1.
Issue: #18398
Diffstat (limited to 'Tests/RunCMake/FileAPI')
9 files changed, 57 insertions, 0 deletions
diff --git a/Tests/RunCMake/FileAPI/RunCMakeTest.cmake b/Tests/RunCMake/FileAPI/RunCMakeTest.cmake index 515a4bd..57c9cc9 100644 --- a/Tests/RunCMake/FileAPI/RunCMakeTest.cmake +++ b/Tests/RunCMake/FileAPI/RunCMakeTest.cmake @@ -54,3 +54,4 @@ function(run_object object) endfunction() run_object(codemodel-v2) +run_object(cache-v2) diff --git a/Tests/RunCMake/FileAPI/cache-v2-ClientStateful-check.cmake b/Tests/RunCMake/FileAPI/cache-v2-ClientStateful-check.cmake new file mode 100644 index 0000000..0f5ef28 --- /dev/null +++ b/Tests/RunCMake/FileAPI/cache-v2-ClientStateful-check.cmake @@ -0,0 +1,11 @@ +set(expect + query + query/client-foo + query/client-foo/query.json + reply + reply/cache-v2-[0-9a-f]+.json + reply/index-[0-9.T-]+.json + ) +check_api("^${expect}$") + +check_python(cache-v2) diff --git a/Tests/RunCMake/FileAPI/cache-v2-ClientStateful-prep.cmake b/Tests/RunCMake/FileAPI/cache-v2-ClientStateful-prep.cmake new file mode 100644 index 0000000..9329280 --- /dev/null +++ b/Tests/RunCMake/FileAPI/cache-v2-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": "cache", "version" : 2 } ] } +]]) diff --git a/Tests/RunCMake/FileAPI/cache-v2-ClientStateless-check.cmake b/Tests/RunCMake/FileAPI/cache-v2-ClientStateless-check.cmake new file mode 100644 index 0000000..c406ec8 --- /dev/null +++ b/Tests/RunCMake/FileAPI/cache-v2-ClientStateless-check.cmake @@ -0,0 +1,11 @@ +set(expect + query + query/client-foo + query/client-foo/cache-v2 + reply + reply/cache-v2-[0-9a-f]+.json + reply/index-[0-9.T-]+.json + ) +check_api("^${expect}$") + +check_python(cache-v2) diff --git a/Tests/RunCMake/FileAPI/cache-v2-ClientStateless-prep.cmake b/Tests/RunCMake/FileAPI/cache-v2-ClientStateless-prep.cmake new file mode 100644 index 0000000..dccafa5 --- /dev/null +++ b/Tests/RunCMake/FileAPI/cache-v2-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/cache-v2" "") diff --git a/Tests/RunCMake/FileAPI/cache-v2-SharedStateless-check.cmake b/Tests/RunCMake/FileAPI/cache-v2-SharedStateless-check.cmake new file mode 100644 index 0000000..f8337eb --- /dev/null +++ b/Tests/RunCMake/FileAPI/cache-v2-SharedStateless-check.cmake @@ -0,0 +1,10 @@ +set(expect + query + query/cache-v2 + reply + reply/cache-v2-[0-9a-f]+.json + reply/index-[0-9.T-]+.json + ) +check_api("^${expect}$") + +check_python(cache-v2) diff --git a/Tests/RunCMake/FileAPI/cache-v2-SharedStateless-prep.cmake b/Tests/RunCMake/FileAPI/cache-v2-SharedStateless-prep.cmake new file mode 100644 index 0000000..ee5ac57 --- /dev/null +++ b/Tests/RunCMake/FileAPI/cache-v2-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/cache-v2" "") diff --git a/Tests/RunCMake/FileAPI/cache-v2-check.py b/Tests/RunCMake/FileAPI/cache-v2-check.py new file mode 100644 index 0000000..13553c3 --- /dev/null +++ b/Tests/RunCMake/FileAPI/cache-v2-check.py @@ -0,0 +1,15 @@ +from check_index import * + +def check_objects(o): + assert is_list(o) + assert len(o) == 1 + check_index_object(o[0], "cache", 2, 0, check_object_cache) + +def check_object_cache(o): + assert sorted(o.keys()) == ["entries", "kind", "version"] + # The "kind" and "version" members are handled by check_index_object. + # FIXME: Check "entries" member + +assert is_dict(index) +assert sorted(index.keys()) == ["cmake", "objects", "reply"] +check_objects(index["objects"]) diff --git a/Tests/RunCMake/FileAPI/cache-v2.cmake b/Tests/RunCMake/FileAPI/cache-v2.cmake new file mode 100644 index 0000000..7b98869 --- /dev/null +++ b/Tests/RunCMake/FileAPI/cache-v2.cmake @@ -0,0 +1 @@ +# FIXME: add some specific cache entries to cover in test, with properties |