FileAPI test: Break gen_check_directories() into JSON files

This commit is contained in:
Kyle Edwards
2020-02-07 11:17:23 -05:00
parent 1605fcbbd9
commit de8ebc9dba
10 changed files with 157 additions and 148 deletions

View File

@@ -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 "):

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -0,0 +1,12 @@
{
"source": "^dir$",
"build": "^dir$",
"parentSource": "^\\.$",
"childSources": [
"^dir/dir$"
],
"targetIds": null,
"projectName": "codemodel-v2",
"minimumCMakeVersion": "3.12",
"hasInstallRule": null
}

View File

@@ -0,0 +1,10 @@
{
"source": "^dir/dir$",
"build": "^dir/dir$",
"parentSource": "^dir$",
"childSources": null,
"targetIds": null,
"projectName": "codemodel-v2",
"minimumCMakeVersion": "3.12",
"hasInstallRule": null
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}