Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions .ci/compute_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"lld": {"llvm"},
"mlir": {"llvm"},
"polly": {"llvm"},
"libcxx": {"clang"},
}

# This mapping describes the additional projects that should be tested when a
Expand Down Expand Up @@ -66,6 +67,7 @@
"libclc",
"openmp",
},
"libcxx": {"lldb"},
}

# This mapping describes runtimes that should be enabled for a specific project,
Expand All @@ -86,6 +88,7 @@
"llvm": {"libcxx", "libcxxabi", "libunwind"},
"clang": {"libcxx", "libcxxabi", "libunwind"},
".ci": {"libcxx", "libcxxabi", "libunwind"},
"libcxx": {"libcxx"},
}

EXCLUDE_LINUX = {
Expand Down Expand Up @@ -197,20 +200,19 @@ def _exclude_projects(current_projects: Set[str], platform: str) -> Set[str]:
def _compute_projects_to_test(modified_projects: Set[str], platform: str) -> Set[str]:
projects_to_test = set()
for modified_project in modified_projects:
if modified_project in DEPENDENTS_TO_TEST:
for dependent_project in DEPENDENTS_TO_TEST[modified_project]:
if (
platform == "Windows"
and dependent_project in EXCLUDE_DEPENDENTS_WINDOWS
):
continue
projects_to_test.add(dependent_project)
if modified_project in RUNTIMES:
continue
# Skip all projects where we cannot run tests.
if modified_project in PROJECT_CHECK_TARGETS:
projects_to_test.add(modified_project)
if modified_project not in DEPENDENTS_TO_TEST:
continue
for dependent_project in DEPENDENTS_TO_TEST[modified_project]:
if (
platform == "Windows"
and dependent_project in EXCLUDE_DEPENDENTS_WINDOWS
):
continue
projects_to_test.add(dependent_project)
projects_to_test = _exclude_projects(projects_to_test, platform)
return projects_to_test

Expand Down
32 changes: 22 additions & 10 deletions .ci/compute_projects_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,16 +239,6 @@ def test_top_level_file(self):
self.assertEqual(env_variables["runtimes_check_targets"], "")
self.assertEqual(env_variables["runtimes_check_targets_needs_reconfig"], "")

def test_exclude_libcxx_in_projects(self):
env_variables = compute_projects.get_env_variables(
["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"], "")
self.assertEqual(env_variables["runtimes_check_targets_needs_reconfig"], "")

def test_include_libc_in_runtimes(self):
env_variables = compute_projects.get_env_variables(
["libc/CMakeLists.txt"], "Linux"
Expand Down Expand Up @@ -413,6 +403,28 @@ def test_third_party_benchmark(self):
"check-cxx check-cxxabi check-unwind",
)

def test_libcxx_linux(self):
env_variables = compute_projects.get_env_variables(
["libcxx/CMakeLists.txt"], "Linux"
)
self.assertEqual(env_variables["projects_to_build"], "clang;lldb;llvm")
self.assertEqual(env_variables["project_check_targets"], "check-lldb")
self.assertEqual(env_variables["runtimes_to_build"], "libcxx")
self.assertEqual(env_variables["runtimes_check_targets"], "")
self.assertEqual(
env_variables["runtimes_check_targets_needs_reconfig"], "check-cxx"
)

def test_libxx_windows(self):
env_variables = compute_projects.get_env_variables(
["libcxx/CMakeLists.txt"], "Windows"
)
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"], "")
self.assertEqual(env_variables["runtimes_check_targets_needs_reconfig"], "")


if __name__ == "__main__":
unittest.main()