|
|
@@ -38,8 +38,10 @@ class ToolchainFileTest : public FileTestBase {
|
|
|
llvm::raw_pwrite_stream& stdout, llvm::raw_pwrite_stream& stderr)
|
|
|
-> ErrorOr<RunResult> override {
|
|
|
CARBON_ASSIGN_OR_RETURN(auto prelude, installation_.ReadPreludeManifest());
|
|
|
- for (const auto& file : prelude) {
|
|
|
- CARBON_RETURN_IF_ERROR(AddFile(*fs, file));
|
|
|
+ if (!is_no_prelude()) {
|
|
|
+ for (const auto& file : prelude) {
|
|
|
+ CARBON_RETURN_IF_ERROR(AddFile(*fs, file));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
Driver driver(fs, &installation_, stdout, stderr);
|
|
|
@@ -83,8 +85,7 @@ class ToolchainFileTest : public FileTestBase {
|
|
|
// For `lex` and `parse`, we don't need to import the prelude; exclude it to
|
|
|
// focus errors. In other phases we only do this for explicit "no_prelude"
|
|
|
// tests.
|
|
|
- if (component_ == "lex" || component_ == "parse" ||
|
|
|
- test_name().find("/no_prelude/") != llvm::StringRef::npos) {
|
|
|
+ if (component_ == "lex" || component_ == "parse" || is_no_prelude()) {
|
|
|
args.push_back("--no-prelude-import");
|
|
|
}
|
|
|
|
|
|
@@ -161,6 +162,10 @@ class ToolchainFileTest : public FileTestBase {
|
|
|
return test_name;
|
|
|
}
|
|
|
|
|
|
+ auto is_no_prelude() const -> bool {
|
|
|
+ return test_name().find("/no_prelude/") != llvm::StringRef::npos;
|
|
|
+ }
|
|
|
+
|
|
|
const llvm::StringRef component_;
|
|
|
const InstallPaths installation_;
|
|
|
};
|