summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/FileAPI
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-11-01 13:45:54 (GMT)
committerBrad King <brad.king@kitware.com>2018-12-12 14:46:13 (GMT)
commit6615408193aa542833ef34c902a35831bd85d25a (patch)
treed49dfcfee3ff655dba5bec0adb7774bf005bb421 /Tests/RunCMake/FileAPI
parent3f6ee75a66042370fe48833bcd5c712448ec59c0 (diff)
downloadCMake-6615408193aa542833ef34c902a35831bd85d25a.zip
CMake-6615408193aa542833ef34c902a35831bd85d25a.tar.gz
CMake-6615408193aa542833ef34c902a35831bd85d25a.tar.bz2
fileapi: add cmakeFiles v1
Issue: #18398
Diffstat (limited to 'Tests/RunCMake/FileAPI')
-rw-r--r--Tests/RunCMake/FileAPI/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateful-check.cmake11
-rw-r--r--Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateful-prep.cmake4
-rw-r--r--Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateless-check.cmake11
-rw-r--r--Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateless-prep.cmake2
-rw-r--r--Tests/RunCMake/FileAPI/cmakeFiles-v1-SharedStateless-check.cmake10
-rw-r--r--Tests/RunCMake/FileAPI/cmakeFiles-v1-SharedStateless-prep.cmake2
-rw-r--r--Tests/RunCMake/FileAPI/cmakeFiles-v1-check.py15
-rw-r--r--Tests/RunCMake/FileAPI/cmakeFiles-v1.cmake0
9 files changed, 56 insertions, 0 deletions
diff --git a/Tests/RunCMake/FileAPI/RunCMakeTest.cmake b/Tests/RunCMake/FileAPI/RunCMakeTest.cmake
index 57c9cc9..f8adb64 100644
--- a/Tests/RunCMake/FileAPI/RunCMakeTest.cmake
+++ b/Tests/RunCMake/FileAPI/RunCMakeTest.cmake
@@ -55,3 +55,4 @@ endfunction()
run_object(codemodel-v2)
run_object(cache-v2)
+run_object(cmakeFiles-v1)
diff --git a/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateful-check.cmake b/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateful-check.cmake
new file mode 100644
index 0000000..21e931e
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateful-check.cmake
@@ -0,0 +1,11 @@
+set(expect
+ query
+ query/client-foo
+ query/client-foo/query.json
+ reply
+ reply/cmakeFiles-v1-[0-9a-f]+.json
+ reply/index-[0-9.T-]+.json
+ )
+check_api("^${expect}$")
+
+check_python(cmakeFiles-v1)
diff --git a/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateful-prep.cmake b/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateful-prep.cmake
new file mode 100644
index 0000000..7a72696
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/cmakeFiles-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": "cmakeFiles", "version" : 1 } ] }
+]])
diff --git a/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateless-check.cmake b/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateless-check.cmake
new file mode 100644
index 0000000..2ce2e79
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateless-check.cmake
@@ -0,0 +1,11 @@
+set(expect
+ query
+ query/client-foo
+ query/client-foo/cmakeFiles-v1
+ reply
+ reply/cmakeFiles-v1-[0-9a-f]+.json
+ reply/index-[0-9.T-]+.json
+ )
+check_api("^${expect}$")
+
+check_python(cmakeFiles-v1)
diff --git a/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateless-prep.cmake b/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateless-prep.cmake
new file mode 100644
index 0000000..eb96491
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/cmakeFiles-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/cmakeFiles-v1" "")
diff --git a/Tests/RunCMake/FileAPI/cmakeFiles-v1-SharedStateless-check.cmake b/Tests/RunCMake/FileAPI/cmakeFiles-v1-SharedStateless-check.cmake
new file mode 100644
index 0000000..6e3b49a
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/cmakeFiles-v1-SharedStateless-check.cmake
@@ -0,0 +1,10 @@
+set(expect
+ query
+ query/cmakeFiles-v1
+ reply
+ reply/cmakeFiles-v1-[0-9a-f]+.json
+ reply/index-[0-9.T-]+.json
+ )
+check_api("^${expect}$")
+
+check_python(cmakeFiles-v1)
diff --git a/Tests/RunCMake/FileAPI/cmakeFiles-v1-SharedStateless-prep.cmake b/Tests/RunCMake/FileAPI/cmakeFiles-v1-SharedStateless-prep.cmake
new file mode 100644
index 0000000..8c8bdef
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/cmakeFiles-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/cmakeFiles-v1" "")
diff --git a/Tests/RunCMake/FileAPI/cmakeFiles-v1-check.py b/Tests/RunCMake/FileAPI/cmakeFiles-v1-check.py
new file mode 100644
index 0000000..25dabf8
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/cmakeFiles-v1-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], "cmakeFiles", 1, 0, check_object_cmakeFiles)
+
+def check_object_cmakeFiles(o):
+ assert sorted(o.keys()) == ["inputs", "kind", "paths", "version"]
+ # The "kind" and "version" members are handled by check_index_object.
+ # FIXME: Check "paths" and "inputs" members.
+
+assert is_dict(index)
+assert sorted(index.keys()) == ["cmake", "objects", "reply"]
+check_objects(index["objects"])
diff --git a/Tests/RunCMake/FileAPI/cmakeFiles-v1.cmake b/Tests/RunCMake/FileAPI/cmakeFiles-v1.cmake
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/cmakeFiles-v1.cmake