This will allow to run the tests with sanitizers settings (such as
suppression files and various options) automatically set.
Details
- Reviewers
deadalnix - Group Reviewers
Restricted Project - Commits
- rSTAGINGbbb9e4b48958: [CMAKE] Set environment variables when running tests with sanitizers
rABCbbb9e4b48958: [CMAKE] Set environment variables when running tests with sanitizers
cmake -GNinja .. -DENABLE_SANITIZERS=undefined # Use any sanitizer ninja check check-functional cmake .. -DENABLE_SANITIZERS=undefined # Use any sanitizer make -j42 check check-functional
Diff Detail
- Repository
- rABC Bitcoin ABC
- Branch
- cmake_sanitizers_suppression
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 10163 Build 18152: Default Diff Build & Tests Build 18151: arc lint + arc unit
Event Timeline
cmake/modules/Sanitizers.cmake | ||
---|---|---|
50 ↗ | (On Diff #18706) | you can do FOO=bar echo $FOO, which is better because you don't change global state accross commands - which is bound to do something weird at some point down the road. |
cmake/modules/TestSuite.cmake | ||
---|---|---|
14 ↗ | (On Diff #18706) | Extract the commands, prepend the environment variables, forward everything. Just like is done for the depfile. |
cmake/modules/TestSuite.cmake | ||
---|---|---|
13 ↗ | (On Diff #18706) | Why add verbatim? Does this need to be added to the depfile thing as well? |
cmake/modules/Sanitizers.cmake | ||
---|---|---|
50 ↗ | (On Diff #18706) | Ninja runs the custom commands (from cmake custom commands or custom targets) in a subshell so it's not an issue. |
cmake/modules/TestSuite.cmake | ||
13 ↗ | (On Diff #18706) | I'm adding VERBATIM because I'm adding commands, so I'd better have proper escaping. |
14 ↗ | (On Diff #18706) | The issue here is that you can't easily extract the commands, because it's a multi keyword multi arguments inputs. |
Change the API, make it environment variable only to take advantage of the cmake -E env command that works for (supposedly, at least ninja and make) all generators.
This is adding a limitation to the custom target as a single command can use these environments.
This is not limitant atm and can always be extended if needed in the future.
cmake/modules/TestSuite.cmake | ||
---|---|---|
16 |
cmake/modules/TestSuite.cmake | ||
---|---|---|
59 | Note to reviewers: the CUSTOM_TARGET_ARGS is necessary for the parsing to know when the command ends. |
Run the test command last, as additional commands are more likely to be useful before it.
cmake/modules/TestSuite.cmake | ||
---|---|---|
16 | You're too fast, see https://reviews.bitcoinabc.org/D5689?id=18722#inline-35330 for the rationale. |