You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Other times, you will want to run the tests on all machines, but only report if certain conditions are true. Front loaded reporters allow a mechanism to jump in front of the standard Reporter path, and divert early.
59
+
60
+
Here is an example of not launching any reporters of you are on the CI machine.
61
+
62
+
<!-- snippet: do_not_report_on_ci -->
63
+
```cpp
64
+
// main.cpp
65
+
auto frontLoadedReportDisposer = Approvals::useAsFrontLoadedReporter(
Once you have added that, even calling approvals with a specific Reporter will not launch it on the CI system (but will for all other systems). For example:
72
+
73
+
<!-- snippet: basic_approval_with_reporter -->
74
+
```cpp
75
+
Approvals::verify("text to be verified", Windows::AraxisMergeReporter());
If you have a lot of approval files, you might want to put them in a subdirectory, to prevent them cluttering up your source files. You can do this at a global or per-test level, by adding the line:
-[Using sub-directories for approved files](#using-sub-directories-for-approved-files)
12
15
13
16
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
14
17
18
+
## Blocking Reporter
19
+
20
+
Blocking reporters are a simple class, designed for use with FrontLoadedReporters, to prevent launching of reporters in certain environments.
21
+
22
+
snippet: do_not_report_on_ci
23
+
24
+
## Machine Blockers
25
+
26
+
Sometimes you will want tests to only run on certain machines. Machine blockers are a great way to do this.
27
+
28
+
snippet: machine_specific_test_runner
29
+
30
+
## Front Loaded Reporters
31
+
32
+
Other times, you will want to run the tests on all machines, but only report if certain conditions are true. Front loaded reporters allow a mechanism to jump in front of the standard Reporter path, and divert early.
33
+
34
+
Here is an example of not launching any reporters of you are on the CI machine.
35
+
36
+
snippet: do_not_report_on_ci
37
+
38
+
Once you have added that, even calling approvals with a specific Reporter will not launch it on the CI system (but will for all other systems). For example:
39
+
40
+
snippet: basic_approval_with_reporter
41
+
15
42
## Using sub-directories for approved files
16
43
17
44
If you have a lot of approval files, you might want to put them in a subdirectory, to prevent them cluttering up your source files. You can do this at a global or per-test level, by adding the line:
0 commit comments