Merge toolchain file_test children in order to improve linking. (#3206)

Specifically this should improve linking by producing one large binary
instead of one-per-directory. The inclusion of the driver hits the size
issue. Separating out things which have more llvm deps has been
discussed, but I'm not doing that here because I think the semantics
layer will need to depend on clang for interop, and we'd lose a lot of
the benefits that way. Also, having just one place to look seems
simpler.

Includes supporting changes to file_test infrastructure, the most
significant of which is probably passing tests via file instead of a
really large args thing, using a custom rule to do that. That's because
dealing with the layered filegroups that allow the toolchain setup is
more complicated, and this approach scales well.

Combined test time is ~9s, so not sharding right now.

I wasn't sure if people would prefer having the autoupdate script under
testing, so I left it alone for now.
This commit is contained in:
Jon Ross-Perkins
2023-09-11 17:54:41 +00:00
committed by GitHub
parent 5fc013b38f
commit 8aa3d960f5
21 changed files with 284 additions and 408 deletions
+3 -3
View File
@@ -18,8 +18,8 @@ namespace {
class ExplorerFileTest : public FileTestBase {
public:
explicit ExplorerFileTest(std::filesystem::path path)
: FileTestBase(std::move(path)),
explicit ExplorerFileTest(llvm::StringRef test_name)
: FileTestBase(test_name),
prelude_line_re_(R"(prelude.carbon:(\d+))"),
timing_re_(R"((Time elapsed in \w+: )\d+(ms))") {
CARBON_CHECK(prelude_line_re_.ok()) << prelude_line_re_.error();
@@ -100,7 +100,7 @@ class ExplorerFileTest : public FileTestBase {
private:
// Trace output is directly checked for a few tests.
auto check_trace_output() -> bool {
return path().string().find("/trace/") != std::string::npos;
return test_name().find("/trace/") != std::string::npos;
}
TestRawOstream trace_stream_;