Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ros2/performance_test_fixture
Test fixture and CMake macro for using osrf_testing_tools_cpp with Google Benchmark
https://github.com/ros2/performance_test_fixture
Last synced: about 1 month ago
JSON representation
Test fixture and CMake macro for using osrf_testing_tools_cpp with Google Benchmark
- Host: GitHub
- URL: https://github.com/ros2/performance_test_fixture
- Owner: ros2
- License: apache-2.0
- Created: 2020-07-16T20:48:51.000Z (over 4 years ago)
- Default Branch: rolling
- Last Pushed: 2024-09-06T19:25:30.000Z (4 months ago)
- Last Synced: 2024-09-06T22:57:30.697Z (4 months ago)
- Language: C++
- Size: 59.6 KB
- Stars: 7
- Watchers: 19
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.rst
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# performance_test_fixture
This repository contains the source code for the `performance_test_fixture` package.
`performance_test_fixture` provides:
1. A Google Benchmark fixture that leverages memory tools from `osrf_testing_tools_cpp` to record memory allocation statistics
2. A CMake macro for compiling, linking, and configuring benchmarking runs, as well as automatically skipping the tests on platforms where the `osrf_testing_tools_cpp` memory tools are not supported## Usage
The test fixture can be used just like any other Google Benchmark fixture:
```c++
#includeusing performance_test_fixture::PerformanceTest;
BENCHMARK_F(PerformanceTest, example_test)(benchmark::State & st)
{
...
}
```The CMake macro can be used in the same way as the rest of the `ament_cmake_test` family of macros:
```cmake
find_package(performance_test_fixture REQUIRED)
add_performance_test(example_test test/example_test.cpp)
```Because it has a large impact on performance, trace messages coming from the memory tools in `osrf_testing_tools_cpp` are suppressed by default.
To enable memory operation trace logging, set the environment variable `PERFORMANCE_TEST_FIXTURE_ENABLE_TRACE=1`.