Forráskód Böngészése

FileAPI test: Break gen_check_directories() into JSON files

Kyle Edwards 5 éve
szülő
commit
de8ebc9dba

+ 9 - 148
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 "):

+ 15 - 0
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
+}

+ 15 - 0
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
+}

+ 19 - 0
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
+}

+ 12 - 0
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
+}

+ 10 - 0
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
+}

+ 14 - 0
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
+}

+ 18 - 0
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
+}

+ 17 - 0
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
+}

+ 28 - 0
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
+}