31 lines
803 B
Bash
Executable File
31 lines
803 B
Bash
Executable File
#!/bin/bash
|
|
# Load environment
|
|
. ./env.sh
|
|
|
|
# Clean build directory
|
|
rm -rf Build_Coverage
|
|
|
|
# Build with coverage
|
|
mkdir -p Build_Coverage
|
|
cd Build_Coverage
|
|
cmake .. -DENABLE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug
|
|
make -j$(nproc)
|
|
|
|
# Reset coverage data
|
|
lcov --directory . --zerocounters
|
|
|
|
# Run unit tests
|
|
./Test/UnitTests/UnitTests
|
|
|
|
# Capture coverage data
|
|
lcov --directory . --capture --output-file coverage.info --ignore-errors inconsistent
|
|
|
|
# Filter out system and MARTe2 internal headers
|
|
lcov --remove coverage.info '/usr/*' '*/dependency/*' '*/Test/*' --output-file coverage_filtered.info --ignore-errors inconsistent
|
|
|
|
# Generate report
|
|
genhtml coverage_filtered.info --output-directory out --ignore-errors inconsistent
|
|
|
|
# Display summary
|
|
lcov --list coverage_filtered.info --ignore-errors inconsistent
|