GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — BehaviorTree.CPP/run_coverage.sh at master · BehaviorTree/BehaviorTree.CPP

Expand file tree

/

run_coverage.sh

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
executable file
·
70 lines (56 loc) · 1.8 KB
/

run_coverage.sh

Copy path

File metadata and controls

executable file
·
70 lines (56 loc) · 1.8 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash
set -e
# Code coverage script for BehaviorTree.CPP
# Based on .github/workflows/cmake_ubuntu.yml coverage job
BUILD_DIR="build/coverage"
COVERAGE_FILE="coverage.info"
COVERAGE_HTML_DIR="coverage_report"
echo "=== BehaviorTree.CPP Code Coverage ==="
# Check for lcov
if ! command -v lcov &> /dev/null; then
echo "Error: lcov is not installed."
echo "Install with: sudo apt-get install lcov"
exit 1
fi
# Clean previous coverage data
echo "Cleaning previous coverage data..."
rm -rf "$BUILD_DIR" "$COVERAGE_FILE" "$COVERAGE_HTML_DIR"
# Configure CMake with coverage flags (plain CMake approach)
echo "Configuring CMake with coverage flags..."
cmake -S . -B "$BUILD_DIR" \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS="--coverage -fprofile-update=atomic" \
-DCMAKE_CXX_FLAGS="--coverage -fprofile-update=atomic"
# Build
echo "Building..."
cmake --build "$BUILD_DIR" --parallel
# Run tests
echo "Running tests..."
ctest --test-dir "$BUILD_DIR" --output-on-failure
# Collect coverage
echo "Collecting coverage data..."
lcov --capture --directory "$BUILD_DIR" \
--output-file "$COVERAGE_FILE"
# Extract only project source files
echo "Filtering coverage data..."
lcov --extract "$COVERAGE_FILE" \
"$(pwd)/include/*" \
"$(pwd)/src/*" \
--output-file "$COVERAGE_FILE" || true
# Remove contrib files
lcov --remove "$COVERAGE_FILE" \
'*/contrib/*' \
--output-file "$COVERAGE_FILE" || true
# Show summary
echo ""
echo "=== Coverage Summary ==="
lcov --list "$COVERAGE_FILE"
# Generate HTML report
if command -v genhtml &> /dev/null; then
echo ""
echo "Generating HTML report..."
genhtml "$COVERAGE_FILE" --output-directory "$COVERAGE_HTML_DIR"
echo "HTML report generated at: $COVERAGE_HTML_DIR/index.html"
fi
echo ""
echo "Coverage data saved to: $COVERAGE_FILE"
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.