Skip to content

Commit

Permalink
Add test coverage for generic replacements functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
dwblaikie committed Aug 22, 2024
1 parent 585f14f commit 7c3f8c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions testing/file_test/file_test_base_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ class FileTestBaseTest : public FileTestBase {
return ErrorBuilder() << "Unexpected file: " << filename;
}
}
auto GetArgReplacements() -> llvm::StringMap<std::string> override {
return {{"replacement", "replaced"}};
}

auto GetDefaultArgs() -> llvm::SmallVector<std::string> override {
return {"default_args", "%s"};
Expand Down
4 changes: 2 additions & 2 deletions testing/file_test/testdata/args.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

// ARGS: abc file=%t %s
// ARGS: abc file=%t %s prefix_%{replacement}_suffix
// AUTOUPDATE
// TIP: To test this file alone, run:
// TIP: bazel test //testing/file_test:file_test_base_test --test_arg=--file_tests=testing/file_test/testdata/args.carbon
// TIP: To dump output, run:
// TIP: bazel run //testing/file_test:file_test_base_test -- --dump_output --file_tests=testing/file_test/testdata/args.carbon

// CHECK:STDOUT: 3 args: `abc`, `file={{.+}}/temp_file`, `args.carbon`
// CHECK:STDOUT: 4 args: `abc`, `file={{.+}}/temp_file`, `args.carbon`, `prefix_replaced_suffix`

0 comments on commit 7c3f8c7

Please sign in to comment.