Adjust ordering of EXTRA-ARGS to allow tests to override includes (#5870)

This commit is contained in:
Jon Ross-Perkins
2025-07-29 20:22:51 +00:00
committed by GitHub
parent 3d6395b75a
commit 64c31a6b9f
3 changed files with 11 additions and 2 deletions
+8 -1
View File
@@ -797,10 +797,14 @@ auto ProcessTestFile(llvm::StringRef test_name, bool running_autoupdate)
// (recursively).
llvm::SmallVector<std::string> include_files;
// Store the main file's `EXTRA-ARGS` so that they can be put after any that
// come from `INCLUDE-FILE`.
llvm::SmallVector<std::string> main_extra_args;
// Process the main file.
CARBON_RETURN_IF_ERROR(ProcessFileContent(
test_name, test_file.input_content, running_autoupdate, &test_file,
&found_autoupdate, test_file.test_args, test_file.extra_args,
&found_autoupdate, test_file.test_args, main_extra_args,
test_file.file_splits, include_files));
if (!found_autoupdate) {
@@ -859,6 +863,9 @@ auto ProcessTestFile(llvm::StringRef test_name, bool running_autoupdate)
}
}
// Copy over `EXTRA-ARGS` from the main file (after includes).
test_file.extra_args.append(main_extra_args);
return std::move(test_file);
}