@@ -33,7 +33,6 @@ A typical implementation will look like:
33
33
```
34
34
#include "my_library.h"
35
35
36
- #include "llvm/ADT/StringExtras.h"
37
36
#include "testing/file_test/file_test_base.h"
38
37
39
38
namespace Carbon::Testing {
@@ -47,8 +46,8 @@ class MyFileTest : public FileTestBase {
47
46
auto Run(const llvm::SmallVector<llvm::StringRef>& test_args,
48
47
const llvm::SmallVector<TestFile>& test_files,
49
48
llvm::raw_pwrite_stream& stdout, llvm::raw_pwrite_stream& stderr)
50
- -> ErrorOr<bool > override {
51
- MyFunctionality(test_args, stdout, stderr);
49
+ -> ErrorOr<RunResult > override {
50
+ return MyFunctionality(test_args, stdout, stderr);
52
51
}
53
52
54
53
// Provides arguments which are used in tests that don't provide ARGS.
@@ -65,6 +64,17 @@ CARBON_FILE_TEST_FACTORY(MyFileTest);
65
64
} // namespace Carbon::Testing
66
65
```
67
66
67
+ ## Filename ` fail_ ` prefixes
68
+
69
+ When a run fails, information about what pieces failed are returned on
70
+ ` RunResult ` . This affects whether a ` fail_ ` prefix on the file is required,
71
+ including in combination with split-file tests (using the ` // --- <filename> `
72
+ comment marker).
73
+
74
+ The main test file and any split-files must have a ` fail_ ` prefix if and only if
75
+ they have an associated error. An exception is that the main test file may omit
76
+ ` fail_ ` when it contains split-files that have a ` fail_ ` prefix.
77
+
68
78
## Comment markers
69
79
70
80
Settings in files are provided in comments, similar to ` FileCheck ` syntax.
0 commit comments