Skip to content
Merged
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
9 changes: 8 additions & 1 deletion .ci/compute_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
"mlir": "check-mlir",
"openmp": "check-openmp",
"polly": "check-polly",
"lit": "check-lit",
}

RUNTIMES = {"libcxx", "libcxxabi", "libunwind", "compiler-rt", "libc", "flang-rt"}
Expand All @@ -166,8 +167,12 @@
("llvm", "utils", "gn"): "gn",
(".github", "workflows", "premerge.yaml"): ".ci",
("third-party",): ".ci",
("llvm", "utils", "lit"): "lit",
}

# Projects that should run tests but cannot be explicitly built.
SKIP_BUILD_PROJECTS = ["CIR", "lit"]

# Projects that should not run any tests. These need to be metaprojects.
SKIP_PROJECTS = ["docs", "gn"]

Expand Down Expand Up @@ -315,7 +320,9 @@ def get_env_variables(modified_files: list[str], platform: str) -> Set[str]:
# clang build, but it requires an explicit option to enable. We set that
# option here, and remove it from the projects_to_build list.
enable_cir = "ON" if "CIR" in projects_to_build else "OFF"
projects_to_build.discard("CIR")
# Remove any metaprojects from the list of projects to build.
for project in SKIP_BUILD_PROJECTS:
projects_to_build.discard(project)

# We use a semicolon to separate the projects/runtimes as they get passed
# to the CMake invocation and thus we need to use the CMake list separator
Expand Down
24 changes: 24 additions & 0 deletions .ci/compute_projects_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,30 @@ def test_third_party_benchmark(self):
"check-cxx check-cxxabi check-unwind",
)

def test_lit(self):
env_variables = compute_projects.get_env_variables(
["llvm/utils/lit/CMakeLists.txt"], "Linux"
)
self.assertEqual(
env_variables["projects_to_build"],
"bolt;clang;clang-tools-extra;flang;lld;lldb;llvm;mlir;polly",
)
self.assertEqual(
env_variables["project_check_targets"],
"check-bolt check-clang check-clang-tools check-flang check-lit check-lld check-lldb check-llvm check-mlir check-polly",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm kind of confused by how we arrive at this list given the changes you made... Is there some kind of fallback for "test everything" involved here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given touching lit (llvm/utils/lit) also touches llvm, we end up testing everything that touching LLVM would. I think this is reasonable enough behavior given it serves as integration testing for lit.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that makes sense. Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't the list just be "check" - doesn't that check every enabled project?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that would be check-all (maybe synonymous with check?). We want to have more control over which test suites we run than check-all gives us (eg build projects but don't test them, split out the runtimes, test runtimes multiple times).

)
self.assertEqual(
env_variables["runtimes_to_build"], "libcxx;libcxxabi;libunwind"
)
self.assertEqual(
env_variables["runtimes_check_targets"],
"",
)
self.assertEqual(
env_variables["runtimes_check_targets_needs_reconfig"],
"check-cxx check-cxxabi check-unwind",
)


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