Skip to content

Commit 03597a0

Browse files
Abseil Teamcopybara-github
Abseil Team
authored andcommitted
Clarify that parameter generator does not evaluate immediately
This aims to avoid confusion as to what kinds of computations are valid inside a parameter generator expression, calling out flags as a supported use case. PiperOrigin-RevId: 483397027 Change-Id: I2d036fae95120d617f30a5566ea7498ce1f9bfb6
1 parent e07617d commit 03597a0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

docs/advanced.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,6 +1095,11 @@ instantiation of the test suite. The next argument is the name of the test
10951095
pattern, and the last is the
10961096
[parameter generator](reference/testing.md#param-generators).
10971097
1098+
The parameter generator expression is not evaluated until GoogleTest is
1099+
initialized (via `InitGoogleTest()`). Any prior initialization done in the
1100+
`main` function will be accessible from the parameter generator, for example,
1101+
the results of flag parsing.
1102+
10981103
You can instantiate a test pattern more than once, so to distinguish different
10991104
instances of the pattern, the instantiation name is added as a prefix to the
11001105
actual test suite name. Remember to pick unique prefixes for different

0 commit comments

Comments
 (0)