summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/FileAPI
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2020-02-07 16:17:23 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2020-02-07 16:17:23 (GMT)
commitde8ebc9dbaddda3178f5cde7638cf3d1f80003e5 (patch)
treea020d1ef4b0d06ff9b7a4ada9653acc43a09bc86 /Tests/RunCMake/FileAPI
parent1605fcbbd95319cc744ec17e49069e01ed681617 (diff)
downloadCMake-de8ebc9dbaddda3178f5cde7638cf3d1f80003e5.zip
CMake-de8ebc9dbaddda3178f5cde7638cf3d1f80003e5.tar.gz
CMake-de8ebc9dbaddda3178f5cde7638cf3d1f80003e5.tar.bz2
FileAPI test: Break gen_check_directories() into JSON files
Diffstat (limited to 'Tests/RunCMake/FileAPI')
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-check.py157
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/alias.json15
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/custom.json15
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json19
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/dir.json12
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/dir_dir.json10
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/external.json14
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/imported.json18
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/object.json17
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json28
10 files changed, 157 insertions, 148 deletions
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-check.py b/Tests/RunCMake/FileAPI/codemodel-v2-check.py
index 00a0e9d..755440a 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-check.py
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-check.py
@@ -477,154 +477,15 @@ def check_project(c):
def gen_check_directories(c, g):
expected = [
- {
- "source": "^\\.$",
- "build": "^\\.$",
- "parentSource": None,
- "childSources": [
- "^alias$",
- "^custom$",
- "^cxx$",
- "^imported$",
- "^object$",
- "^.*/Tests/RunCMake/FileAPIExternalSource$",
- "^dir$",
- ],
- "targetIds": [
- "^ALL_BUILD::@6890427a1f51a3e7e1df$",
- "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
- "^c_exe::@6890427a1f51a3e7e1df$",
- "^c_lib::@6890427a1f51a3e7e1df$",
- "^c_shared_exe::@6890427a1f51a3e7e1df$",
- "^c_shared_lib::@6890427a1f51a3e7e1df$",
- "^c_static_exe::@6890427a1f51a3e7e1df$",
- "^c_static_lib::@6890427a1f51a3e7e1df$",
- "^interface_exe::@6890427a1f51a3e7e1df$",
- ],
- "projectName": "codemodel-v2",
- "minimumCMakeVersion": "3.12",
- "hasInstallRule": True,
- },
- {
- "source": "^alias$",
- "build": "^alias$",
- "parentSource": "^\\.$",
- "childSources": None,
- "targetIds": [
- "^ALL_BUILD::@53632cba2752272bb008$",
- "^ZERO_CHECK::@53632cba2752272bb008$",
- "^c_alias_exe::@53632cba2752272bb008$",
- "^cxx_alias_exe::@53632cba2752272bb008$",
- ],
- "projectName": "Alias",
- "minimumCMakeVersion": "3.12",
- "hasInstallRule": None,
- },
- {
- "source": "^custom$",
- "build": "^custom$",
- "parentSource": "^\\.$",
- "childSources": None,
- "targetIds": [
- "^ALL_BUILD::@c11385ffed57b860da63$",
- "^ZERO_CHECK::@c11385ffed57b860da63$",
- "^custom_exe::@c11385ffed57b860da63$",
- "^custom_tgt::@c11385ffed57b860da63$",
- ],
- "projectName": "Custom",
- "minimumCMakeVersion": "3.12",
- "hasInstallRule": None,
- },
- {
- "source": "^cxx$",
- "build": "^cxx$",
- "parentSource": "^\\.$",
- "childSources": None,
- "targetIds": [
- "^ALL_BUILD::@a56b12a3f5c0529fb296$",
- "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
- "^cxx_exe::@a56b12a3f5c0529fb296$",
- "^cxx_lib::@a56b12a3f5c0529fb296$",
- "^cxx_shared_exe::@a56b12a3f5c0529fb296$",
- "^cxx_shared_lib::@a56b12a3f5c0529fb296$",
- "^cxx_static_exe::@a56b12a3f5c0529fb296$",
- "^cxx_static_lib::@a56b12a3f5c0529fb296$",
- ],
- "projectName": "Cxx",
- "minimumCMakeVersion": "3.12",
- "hasInstallRule": None,
- },
- {
- "source": "^imported$",
- "build": "^imported$",
- "parentSource": "^\\.$",
- "childSources": None,
- "targetIds": [
- "^ALL_BUILD::@ba7eb709d0b48779c6c8$",
- "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
- "^link_imported_exe::@ba7eb709d0b48779c6c8$",
- "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$",
- "^link_imported_object_exe::@ba7eb709d0b48779c6c8$",
- "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$",
- "^link_imported_static_exe::@ba7eb709d0b48779c6c8$",
- ],
- "projectName": "Imported",
- "minimumCMakeVersion": "3.12",
- "hasInstallRule": None,
- },
- {
- "source": "^object$",
- "build": "^object$",
- "parentSource": "^\\.$",
- "childSources": None,
- "targetIds": [
- "^ALL_BUILD::@5ed5358f70faf8d8af7a$",
- "^ZERO_CHECK::@5ed5358f70faf8d8af7a$",
- "^c_object_exe::@5ed5358f70faf8d8af7a$",
- "^c_object_lib::@5ed5358f70faf8d8af7a$",
- "^cxx_object_exe::@5ed5358f70faf8d8af7a$",
- "^cxx_object_lib::@5ed5358f70faf8d8af7a$",
- ],
- "projectName": "Object",
- "minimumCMakeVersion": "3.13",
- "hasInstallRule": True,
- },
- {
- "source": "^dir$",
- "build": "^dir$",
- "parentSource": "^\\.$",
- "childSources": [
- "^dir/dir$",
- ],
- "targetIds": None,
- "projectName": "codemodel-v2",
- "minimumCMakeVersion": "3.12",
- "hasInstallRule": None,
- },
- {
- "source": "^dir/dir$",
- "build": "^dir/dir$",
- "parentSource": "^dir$",
- "childSources": None,
- "targetIds": None,
- "projectName": "codemodel-v2",
- "minimumCMakeVersion": "3.12",
- "hasInstallRule": None,
- },
- {
- "source": "^.*/Tests/RunCMake/FileAPIExternalSource$",
- "build": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$",
- "parentSource": "^\\.$",
- "childSources": None,
- "targetIds": [
- "^ALL_BUILD::@[0-9a-f]+$",
- "^ZERO_CHECK::@[0-9a-f]+$",
- "^generated_exe::@[0-9a-f]+$",
- ],
- "projectName": "External",
- "minimumCMakeVersion": "3.12",
- "hasInstallRule": None,
- },
+ read_codemodel_json_data("directories/top.json"),
+ read_codemodel_json_data("directories/alias.json"),
+ read_codemodel_json_data("directories/custom.json"),
+ read_codemodel_json_data("directories/cxx.json"),
+ read_codemodel_json_data("directories/imported.json"),
+ read_codemodel_json_data("directories/object.json"),
+ read_codemodel_json_data("directories/dir.json"),
+ read_codemodel_json_data("directories/dir_dir.json"),
+ read_codemodel_json_data("directories/external.json"),
]
if matches(g["name"], "^Visual Studio "):
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/alias.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/alias.json
new file mode 100644
index 0000000..9f0c48a
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/alias.json
@@ -0,0 +1,15 @@
+{
+ "source": "^alias$",
+ "build": "^alias$",
+ "parentSource": "^\\.$",
+ "childSources": null,
+ "targetIds": [
+ "^ALL_BUILD::@53632cba2752272bb008$",
+ "^ZERO_CHECK::@53632cba2752272bb008$",
+ "^c_alias_exe::@53632cba2752272bb008$",
+ "^cxx_alias_exe::@53632cba2752272bb008$"
+ ],
+ "projectName": "Alias",
+ "minimumCMakeVersion": "3.12",
+ "hasInstallRule": null
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/custom.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/custom.json
new file mode 100644
index 0000000..afd41f3
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/custom.json
@@ -0,0 +1,15 @@
+{
+ "source": "^custom$",
+ "build": "^custom$",
+ "parentSource": "^\\.$",
+ "childSources": null,
+ "targetIds": [
+ "^ALL_BUILD::@c11385ffed57b860da63$",
+ "^ZERO_CHECK::@c11385ffed57b860da63$",
+ "^custom_exe::@c11385ffed57b860da63$",
+ "^custom_tgt::@c11385ffed57b860da63$"
+ ],
+ "projectName": "Custom",
+ "minimumCMakeVersion": "3.12",
+ "hasInstallRule": null
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json
new file mode 100644
index 0000000..ebe717a
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json
@@ -0,0 +1,19 @@
+{
+ "source": "^cxx$",
+ "build": "^cxx$",
+ "parentSource": "^\\.$",
+ "childSources": null,
+ "targetIds": [
+ "^ALL_BUILD::@a56b12a3f5c0529fb296$",
+ "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
+ "^cxx_exe::@a56b12a3f5c0529fb296$",
+ "^cxx_lib::@a56b12a3f5c0529fb296$",
+ "^cxx_shared_exe::@a56b12a3f5c0529fb296$",
+ "^cxx_shared_lib::@a56b12a3f5c0529fb296$",
+ "^cxx_static_exe::@a56b12a3f5c0529fb296$",
+ "^cxx_static_lib::@a56b12a3f5c0529fb296$"
+ ],
+ "projectName": "Cxx",
+ "minimumCMakeVersion": "3.12",
+ "hasInstallRule": null
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/dir.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/dir.json
new file mode 100644
index 0000000..afbd43a
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/dir.json
@@ -0,0 +1,12 @@
+{
+ "source": "^dir$",
+ "build": "^dir$",
+ "parentSource": "^\\.$",
+ "childSources": [
+ "^dir/dir$"
+ ],
+ "targetIds": null,
+ "projectName": "codemodel-v2",
+ "minimumCMakeVersion": "3.12",
+ "hasInstallRule": null
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/dir_dir.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/dir_dir.json
new file mode 100644
index 0000000..3737ad5
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/dir_dir.json
@@ -0,0 +1,10 @@
+{
+ "source": "^dir/dir$",
+ "build": "^dir/dir$",
+ "parentSource": "^dir$",
+ "childSources": null,
+ "targetIds": null,
+ "projectName": "codemodel-v2",
+ "minimumCMakeVersion": "3.12",
+ "hasInstallRule": null
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/external.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/external.json
new file mode 100644
index 0000000..521e3c7
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/external.json
@@ -0,0 +1,14 @@
+{
+ "source": "^.*/Tests/RunCMake/FileAPIExternalSource$",
+ "build": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$",
+ "parentSource": "^\\.$",
+ "childSources": null,
+ "targetIds": [
+ "^ALL_BUILD::@[0-9a-f]+$",
+ "^ZERO_CHECK::@[0-9a-f]+$",
+ "^generated_exe::@[0-9a-f]+$"
+ ],
+ "projectName": "External",
+ "minimumCMakeVersion": "3.12",
+ "hasInstallRule": null
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/imported.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/imported.json
new file mode 100644
index 0000000..a41b79b
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/imported.json
@@ -0,0 +1,18 @@
+{
+ "source": "^imported$",
+ "build": "^imported$",
+ "parentSource": "^\\.$",
+ "childSources": null,
+ "targetIds": [
+ "^ALL_BUILD::@ba7eb709d0b48779c6c8$",
+ "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
+ "^link_imported_exe::@ba7eb709d0b48779c6c8$",
+ "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$",
+ "^link_imported_object_exe::@ba7eb709d0b48779c6c8$",
+ "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$",
+ "^link_imported_static_exe::@ba7eb709d0b48779c6c8$"
+ ],
+ "projectName": "Imported",
+ "minimumCMakeVersion": "3.12",
+ "hasInstallRule": null
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/object.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/object.json
new file mode 100644
index 0000000..1e647ad
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/object.json
@@ -0,0 +1,17 @@
+{
+ "source": "^object$",
+ "build": "^object$",
+ "parentSource": "^\\.$",
+ "childSources": null,
+ "targetIds": [
+ "^ALL_BUILD::@5ed5358f70faf8d8af7a$",
+ "^ZERO_CHECK::@5ed5358f70faf8d8af7a$",
+ "^c_object_exe::@5ed5358f70faf8d8af7a$",
+ "^c_object_lib::@5ed5358f70faf8d8af7a$",
+ "^cxx_object_exe::@5ed5358f70faf8d8af7a$",
+ "^cxx_object_lib::@5ed5358f70faf8d8af7a$"
+ ],
+ "projectName": "Object",
+ "minimumCMakeVersion": "3.13",
+ "hasInstallRule": true
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json
new file mode 100644
index 0000000..c144953
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json
@@ -0,0 +1,28 @@
+{
+ "source": "^\\.$",
+ "build": "^\\.$",
+ "parentSource": null,
+ "childSources": [
+ "^alias$",
+ "^custom$",
+ "^cxx$",
+ "^imported$",
+ "^object$",
+ "^.*/Tests/RunCMake/FileAPIExternalSource$",
+ "^dir$"
+ ],
+ "targetIds": [
+ "^ALL_BUILD::@6890427a1f51a3e7e1df$",
+ "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
+ "^c_exe::@6890427a1f51a3e7e1df$",
+ "^c_lib::@6890427a1f51a3e7e1df$",
+ "^c_shared_exe::@6890427a1f51a3e7e1df$",
+ "^c_shared_lib::@6890427a1f51a3e7e1df$",
+ "^c_static_exe::@6890427a1f51a3e7e1df$",
+ "^c_static_lib::@6890427a1f51a3e7e1df$",
+ "^interface_exe::@6890427a1f51a3e7e1df$"
+ ],
+ "projectName": "codemodel-v2",
+ "minimumCMakeVersion": "3.12",
+ "hasInstallRule": true
+}