mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 23:36:40 +00:00
[CI] Exclude runtimes from being tested as projects
Before this patch, making a change to a runtime directory (like libcxx) would cause the project to be added to the LLVM_ENABLE_PROJECTS CMake flag which is illegal as they can only be built as part of LLVM_ENABLE_RUNTIMES. This patch fixes that behavior. Test added.
This commit is contained in:
parent
2b43ecd27b
commit
7da71a6b71
@ -112,6 +112,8 @@ PROJECT_CHECK_TARGETS = {
|
||||
"polly": "check-polly",
|
||||
}
|
||||
|
||||
RUNTIMES = {"libcxx", "libcxxabi", "libunwind"}
|
||||
|
||||
|
||||
def _add_dependencies(projects: Set[str]) -> Set[str]:
|
||||
projects_with_dependents = set(projects)
|
||||
@ -131,6 +133,8 @@ def _compute_projects_to_test(modified_projects: Set[str], platform: str) -> Set
|
||||
# Skip all projects where we cannot run tests.
|
||||
if modified_project not in PROJECT_CHECK_TARGETS:
|
||||
continue
|
||||
if modified_project in RUNTIMES:
|
||||
continue
|
||||
projects_to_test.add(modified_project)
|
||||
if modified_project not in DEPENDENTS_TO_TEST:
|
||||
continue
|
||||
|
@ -161,6 +161,15 @@ class TestComputeProjects(unittest.TestCase):
|
||||
self.assertEqual(env_variables["runtimes_to_build"], "")
|
||||
self.assertEqual(env_variables["runtimes_check_targets"], "")
|
||||
|
||||
def test_blah(self):
|
||||
env_variables = compute_projects.get_env_variables(
|
||||
[".ci/compute_projects.py", "libcxx/CMakeLists.txt"], "Linux"
|
||||
)
|
||||
self.assertEqual(env_variables["projects_to_build"], "")
|
||||
self.assertEqual(env_variables["project_check_targets"], "")
|
||||
self.assertEqual(env_variables["runtimes_to_build"], "")
|
||||
self.assertEqual(env_variables["runtimes_check_targets"], "")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
Loading…
x
Reference in New Issue
Block a user