Break out driver environment info into its own type. (#4299)

I want to split commands out so that we don't keep piling onto driver
(particularly as I'm eyeing clang-related commands). This extracts out
the DriverEnv so that it can be easily shared, with the CompilationUnit
as an example.

CARBON_VLOG_TO is to remove the vlog_stream_ requirement of CARBON_VLOG.
This commit is contained in:
Jon Ross-Perkins
2024-09-12 00:06:31 +00:00
committed by GitHub
parent d6b2fb1736
commit de57c9988c
6 changed files with 114 additions and 70 deletions
+8
View File
@@ -49,5 +49,13 @@ TEST(VLogTest, Disabled) {
EXPECT_THAT(vlog.TakeStr(), IsEmpty());
}
TEST(VLogTest, To) {
TestRawOstream buffer;
CARBON_VLOG_TO(&buffer, "Test");
EXPECT_THAT(buffer.TakeStr(), "Test");
}
TEST(VLogTest, ToNull) { CARBON_VLOG_TO(nullptr, "Unused"); }
} // namespace
} // namespace Carbon::Testing