Build Time Actions
This page details LIBRA usage and actions when after you’ve invoked CMake on the cmdline (see Configure-Time Actions), and the build system has been generated.
Note
All examples assume the CMake generator is Unix Makefiles, and
therefore all targets can be built with make; adjust as needed if
you use a different generator.
Quick Reference
Common Workflows
Build and run tests:
make build-and-test
Generate code coverage (GNU/gcov format):
make all-tests
make test
make gcovr-report # or gcovr-check for threshold checking
Generate code coverage (LLVM/Clang format):
make all-tests
make test
make llvm-coverage # Generates HTML + summary
Run static analysis:
make analyze # All analyzers
make analyze-clang-tidy # Just clang-tidy
Auto-fix code style:
make format # All formatters
make fix-clang-tidy # Auto-fix clang-tidy warnings
Actions That Build Things
Target |
Description |
|---|---|
|
Build all of the unit tests for the project. If you want to just build a
single unit test, you can do make hfsm-utest
for a single unit test named Requires that |
|
Build all of the integration tests for the project. If you want to just
build a single test, you can do make hfsm-itest
for a single unit test named Requires that |
|
Build all of the regression tests for the project. If you want to just
build a single test, you can do make hfsm-itest
for a single unit test named Requires that |
|
Build Requires that |
|
Build all of the integration and unit tests for the project; same as
Requires that |
Actions For Supporting SW Engineering
Target |
Description |
|---|---|
|
Run all of the built tests for the project via |
|
Run ALL enabled formatters on the repository. This runs the following sub-targets, which can also be run individually:
Requires Added in version 0.8.15. |
|
Run ALL enabled static checkers on the repository. This runs the following sub-targets, which can also be run individually:
Changed in version 0.8.5: This family of targets used to be called Requires |
|
Run ALL enabled auto fixers on the repository. This runs the following sub-targets, which can also be run individually:
Requires |
|
Generate the API documentation. Requires |
|
Check the API documentation. This runs the following sub-targets, which can also be run individually:
Requires |
|
Build one or more deployable packages using CPACK. Requires
Requires |
|
Capture baseline code coverage info (0%) for the entire project before
running any tests. This is the first step in generating an absolute
coverage report. See Requires |
|
Generate an HTML code coverage report using lcov/genhtml. This produces an absolute coverage report, meaning:
Typical workflow: cmake -DCMAKE_BUILD_TYPE=Debug -DLIBRA_CODE_COV=ON ..
make # Build project with coverage
make all-tests # Build tests with coverage
make lcov-preinfo # Capture baseline (0% coverage)
make test # Run tests to generate coverage data
make lcov-report # Generate HTML report
Opens Requires |
|
Generate an HTML code coverage report using gcovr. This produces a relative coverage report, meaning:
Typical workflow: cmake -DCMAKE_BUILD_TYPE=Debug -DLIBRA_CODE_COV=ON ..
make # Build project with coverage
make all-tests # Build tests with coverage
make test # Run tests to generate coverage data
make gcovr-report # Generate HTML report (relative)
Use Requires |
|
Run make # Build in coverage info into project
make all-tests # Build in coverage info into tests
make test # Populate coverage for executed parts of project
make gcovr-check # Check coverage against configured thresholds
Requires
|
|
Merge raw LLVM profile data ( make test # Generate .profraw files
make llvm-profdata # Merge into coverage.profdata
Requires
|
|
Run make # Build in coverage info into project
make all-tests # Build in coverage info into tests
make test # Populate coverage for executed parts of project
make llvm-summary # Build RELATIVE report for files had some execution
Requires |
|
Run make # Build in coverage info into project
make all-tests # Build in coverage info into tests
make test # Populate coverage for executed parts of project
make llvm-show # Build RELATIVE report for files had some execution
Requires |
|
Run make # Build in coverage info into project
make all-tests # Build in coverage info into tests
make test # Populate coverage for executed parts of project
make llvm-report # Build RELATIVE report for files had some execution
Requires |
|
Run make # Build in coverage info into project
make all-tests # Build in coverage info into tests
make test # Populate coverage for executed parts of project
make llvm-export-lcov # Export
Requires |
|
Run make # Build in coverage info into project
make all-tests # Build in coverage info into tests
make test # Populate coverage for executed parts of project
make llvm-coverage # Generate HTML and text reports
Requires |