mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 09:34:42 +01:00
Fix invocation issues with clang runner (#4353)
`ToolContext` should be explicitly initialized. `-c` can still require a valid, writable `-o` path. --------- Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
This commit is contained in:
co-authored by
Chandler Carruth
parent
42bda1e38f
commit
4332d8239d
@@ -155,6 +155,7 @@ TEST(ClangRunnerTest, LinkCommandEcho) {
|
||||
TEST(ClangRunnerTest, DashC) {
|
||||
std::filesystem::path test_file =
|
||||
WriteTestFile("test.cpp", "int test() { return 0; }");
|
||||
std::filesystem::path test_output = WriteTestFile("test.o", "");
|
||||
|
||||
const auto install_paths =
|
||||
InstallPaths::MakeForBazelRunfiles(Testing::GetExePath());
|
||||
@@ -164,11 +165,12 @@ TEST(ClangRunnerTest, DashC) {
|
||||
ClangRunner runner(&install_paths, target, &verbose_os);
|
||||
std::string out;
|
||||
std::string err;
|
||||
EXPECT_TRUE(
|
||||
RunWithCapturedOutput(out, err,
|
||||
[&] {
|
||||
return runner.Run({"-c", test_file.string()});
|
||||
}))
|
||||
EXPECT_TRUE(RunWithCapturedOutput(out, err,
|
||||
[&] {
|
||||
return runner.Run(
|
||||
{"-c", test_file.string(), "-o",
|
||||
test_output.string()});
|
||||
}))
|
||||
<< "Verbose output from runner:\n"
|
||||
<< verbose_out << "\n";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user