diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2020-02-07 18:42:20 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2020-02-07 18:42:20 (GMT) |
commit | 75e71263e77edd9f1c15cf4f32ca91c46e3e7a7b (patch) | |
tree | 08e3449145b83aa565a8da9c3b129a30c9f7c17c /Tests/RunCMake/FileAPI | |
parent | a0de350e2fcb9f0ff90c2207d0e8c097d5255ecc (diff) | |
download | CMake-75e71263e77edd9f1c15cf4f32ca91c46e3e7a7b.zip CMake-75e71263e77edd9f1c15cf4f32ca91c46e3e7a7b.tar.gz CMake-75e71263e77edd9f1c15cf4f32ca91c46e3e7a7b.tar.bz2 |
FileAPI test: Break gen_check_projects() into JSON files
Diffstat (limited to 'Tests/RunCMake/FileAPI')
8 files changed, 127 insertions, 120 deletions
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-check.py b/Tests/RunCMake/FileAPI/codemodel-v2-check.py index 53224e4..9ee0c20 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-check.py +++ b/Tests/RunCMake/FileAPI/codemodel-v2-check.py @@ -655,126 +655,13 @@ def check_targets(c, g, inSource): def gen_check_projects(c, g): expected = [ - { - "name": "codemodel-v2", - "parentName": None, - "childNames": [ - "Alias", - "Custom", - "Cxx", - "Imported", - "Object", - "External", - ], - "directorySources": [ - "^\\.$", - "^dir$", - "^dir/dir$", - ], - "targetIds": [ - "^ALL_BUILD::@6890427a1f51a3e7e1df$", - "^ZERO_CHECK::@6890427a1f51a3e7e1df$", - "^interface_exe::@6890427a1f51a3e7e1df$", - "^c_lib::@6890427a1f51a3e7e1df$", - "^c_exe::@6890427a1f51a3e7e1df$", - "^c_shared_lib::@6890427a1f51a3e7e1df$", - "^c_shared_exe::@6890427a1f51a3e7e1df$", - "^c_static_lib::@6890427a1f51a3e7e1df$", - "^c_static_exe::@6890427a1f51a3e7e1df$", - ], - }, - { - "name": "Cxx", - "parentName": "codemodel-v2", - "childNames": None, - "directorySources": [ - "^cxx$", - ], - "targetIds": [ - "^ALL_BUILD::@a56b12a3f5c0529fb296$", - "^ZERO_CHECK::@a56b12a3f5c0529fb296$", - "^cxx_lib::@a56b12a3f5c0529fb296$", - "^cxx_exe::@a56b12a3f5c0529fb296$", - "^cxx_shared_lib::@a56b12a3f5c0529fb296$", - "^cxx_shared_exe::@a56b12a3f5c0529fb296$", - "^cxx_static_lib::@a56b12a3f5c0529fb296$", - "^cxx_static_exe::@a56b12a3f5c0529fb296$", - ], - }, - { - "name": "Alias", - "parentName": "codemodel-v2", - "childNames": None, - "directorySources": [ - "^alias$", - ], - "targetIds": [ - "^ALL_BUILD::@53632cba2752272bb008$", - "^ZERO_CHECK::@53632cba2752272bb008$", - "^c_alias_exe::@53632cba2752272bb008$", - "^cxx_alias_exe::@53632cba2752272bb008$", - ], - }, - { - "name": "Object", - "parentName": "codemodel-v2", - "childNames": None, - "directorySources": [ - "^object$", - ], - "targetIds": [ - "^ALL_BUILD::@5ed5358f70faf8d8af7a$", - "^ZERO_CHECK::@5ed5358f70faf8d8af7a$", - "^c_object_lib::@5ed5358f70faf8d8af7a$", - "^c_object_exe::@5ed5358f70faf8d8af7a$", - "^cxx_object_lib::@5ed5358f70faf8d8af7a$", - "^cxx_object_exe::@5ed5358f70faf8d8af7a$", - ], - }, - { - "name": "Imported", - "parentName": "codemodel-v2", - "childNames": None, - "directorySources": [ - "^imported$", - ], - "targetIds": [ - "^ALL_BUILD::@ba7eb709d0b48779c6c8$", - "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", - "^link_imported_exe::@ba7eb709d0b48779c6c8$", - "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$", - "^link_imported_static_exe::@ba7eb709d0b48779c6c8$", - "^link_imported_object_exe::@ba7eb709d0b48779c6c8$", - "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$", - ], - }, - { - "name": "Custom", - "parentName": "codemodel-v2", - "childNames": None, - "directorySources": [ - "^custom$", - ], - "targetIds": [ - "^ALL_BUILD::@c11385ffed57b860da63$", - "^ZERO_CHECK::@c11385ffed57b860da63$", - "^custom_tgt::@c11385ffed57b860da63$", - "^custom_exe::@c11385ffed57b860da63$", - ], - }, - { - "name": "External", - "parentName": "codemodel-v2", - "childNames": None, - "directorySources": [ - "^.*/Tests/RunCMake/FileAPIExternalSource$", - ], - "targetIds": [ - "^ALL_BUILD::@[0-9a-f]+$", - "^ZERO_CHECK::@[0-9a-f]+$", - "^generated_exe::@[0-9a-f]+$", - ], - }, + read_codemodel_json_data("projects/codemodel-v2.json"), + read_codemodel_json_data("projects/cxx.json"), + read_codemodel_json_data("projects/alias.json"), + read_codemodel_json_data("projects/object.json"), + read_codemodel_json_data("projects/imported.json"), + read_codemodel_json_data("projects/custom.json"), + read_codemodel_json_data("projects/external.json"), ] if matches(g["name"], "^Visual Studio "): diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/alias.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/alias.json new file mode 100644 index 0000000..8ede60f --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/alias.json @@ -0,0 +1,14 @@ +{ + "name": "Alias", + "parentName": "codemodel-v2", + "childNames": null, + "directorySources": [ + "^alias$" + ], + "targetIds": [ + "^ALL_BUILD::@53632cba2752272bb008$", + "^ZERO_CHECK::@53632cba2752272bb008$", + "^c_alias_exe::@53632cba2752272bb008$", + "^cxx_alias_exe::@53632cba2752272bb008$" + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/codemodel-v2.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/codemodel-v2.json new file mode 100644 index 0000000..f3aac63 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/codemodel-v2.json @@ -0,0 +1,28 @@ +{ + "name": "codemodel-v2", + "parentName": null, + "childNames": [ + "Alias", + "Custom", + "Cxx", + "Imported", + "Object", + "External" + ], + "directorySources": [ + "^\\.$", + "^dir$", + "^dir/dir$" + ], + "targetIds": [ + "^ALL_BUILD::@6890427a1f51a3e7e1df$", + "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "^interface_exe::@6890427a1f51a3e7e1df$", + "^c_lib::@6890427a1f51a3e7e1df$", + "^c_exe::@6890427a1f51a3e7e1df$", + "^c_shared_lib::@6890427a1f51a3e7e1df$", + "^c_shared_exe::@6890427a1f51a3e7e1df$", + "^c_static_lib::@6890427a1f51a3e7e1df$", + "^c_static_exe::@6890427a1f51a3e7e1df$" + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/custom.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/custom.json new file mode 100644 index 0000000..0aeb727 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/custom.json @@ -0,0 +1,14 @@ +{ + "name": "Custom", + "parentName": "codemodel-v2", + "childNames": null, + "directorySources": [ + "^custom$" + ], + "targetIds": [ + "^ALL_BUILD::@c11385ffed57b860da63$", + "^ZERO_CHECK::@c11385ffed57b860da63$", + "^custom_tgt::@c11385ffed57b860da63$", + "^custom_exe::@c11385ffed57b860da63$" + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/cxx.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/cxx.json new file mode 100644 index 0000000..296ae6c --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/cxx.json @@ -0,0 +1,18 @@ +{ + "name": "Cxx", + "parentName": "codemodel-v2", + "childNames": null, + "directorySources": [ + "^cxx$" + ], + "targetIds": [ + "^ALL_BUILD::@a56b12a3f5c0529fb296$", + "^ZERO_CHECK::@a56b12a3f5c0529fb296$", + "^cxx_lib::@a56b12a3f5c0529fb296$", + "^cxx_exe::@a56b12a3f5c0529fb296$", + "^cxx_shared_lib::@a56b12a3f5c0529fb296$", + "^cxx_shared_exe::@a56b12a3f5c0529fb296$", + "^cxx_static_lib::@a56b12a3f5c0529fb296$", + "^cxx_static_exe::@a56b12a3f5c0529fb296$" + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/external.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/external.json new file mode 100644 index 0000000..3c9afff --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/external.json @@ -0,0 +1,13 @@ +{ + "name": "External", + "parentName": "codemodel-v2", + "childNames": null, + "directorySources": [ + "^.*/Tests/RunCMake/FileAPIExternalSource$" + ], + "targetIds": [ + "^ALL_BUILD::@[0-9a-f]+$", + "^ZERO_CHECK::@[0-9a-f]+$", + "^generated_exe::@[0-9a-f]+$" + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/imported.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/imported.json new file mode 100644 index 0000000..dc40b72 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/imported.json @@ -0,0 +1,17 @@ +{ + "name": "Imported", + "parentName": "codemodel-v2", + "childNames": null, + "directorySources": [ + "^imported$" + ], + "targetIds": [ + "^ALL_BUILD::@ba7eb709d0b48779c6c8$", + "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", + "^link_imported_exe::@ba7eb709d0b48779c6c8$", + "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$", + "^link_imported_static_exe::@ba7eb709d0b48779c6c8$", + "^link_imported_object_exe::@ba7eb709d0b48779c6c8$", + "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$" + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/object.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/object.json new file mode 100644 index 0000000..219f4eb --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/object.json @@ -0,0 +1,16 @@ +{ + "name": "Object", + "parentName": "codemodel-v2", + "childNames": null, + "directorySources": [ + "^object$" + ], + "targetIds": [ + "^ALL_BUILD::@5ed5358f70faf8d8af7a$", + "^ZERO_CHECK::@5ed5358f70faf8d8af7a$", + "^c_object_lib::@5ed5358f70faf8d8af7a$", + "^c_object_exe::@5ed5358f70faf8d8af7a$", + "^cxx_object_lib::@5ed5358f70faf8d8af7a$", + "^cxx_object_exe::@5ed5358f70faf8d8af7a$" + ] +} |