Convenience scripts for common development tasks. Think of these like npm scripts!
Build the project with different configurations.
Modes:
debug- Debug build with debug symbolsrelease- Optimized release build (default)tsan- Debug build with Thread Sanitizer enabled
Examples:
./scripts/build.sh # Release build
./scripts/build.sh debug # Debug build
./scripts/build.sh tsan # Build with TSANBuild (if needed) and run all tests.
Modes:
debug- Run tests in debug moderelease- Run tests in release mode (default)tsan- Run tests with Thread Sanitizer (useful for detecting race conditions!)
Examples:
./scripts/test.sh # Release build tests
./scripts/test.sh debug # Debug build tests
./scripts/test.sh tsan # Tests with Thread SanitizerRun the demo executable.
Automatically builds if needed, then runs the main executable without having to navigate into the build directory.
Modes:
debug- Run demo in debug moderelease- Run demo in release mode (default)tsan- Run demo with Thread Sanitizer
Examples:
./scripts/run.sh # Release build
./scripts/run.sh debug # Debug build
./scripts/run.sh tsan # Run with Thread SanitizerRun benchmarks with optional arguments.
Automatically builds if needed. You can pass any Google Benchmark arguments.
./scripts/benchmark.sh # Run all benchmarks
./scripts/benchmark.sh --help # Show benchmark options
./scripts/benchmark.sh --benchmark_filter=MyTest # Run specific benchmark
./scripts/benchmark.sh --benchmark_min_time=1s # Run for at least 1 secondRemove build artifacts and coverage data.
./scripts/clean.shGenerate detailed HTML coverage report (for local development).
Requirements:
gcov(usually comes with GCC)lcov- Install with:brew install lcovorapt install lcov
Output:
Creates an HTML coverage report in coverage/html/index.html
Use case: Local development - see exactly which lines aren't covered
./scripts/coverage.sh
open coverage/html/index.html # macOS
xdg-open coverage/html/index.html # LinuxGenerate coverage summary with threshold check (for CI/CD).
Arguments:
threshold- Minimum line coverage percentage (default: 80)
Output:
- Text summary only (no HTML)
- Exits with error if coverage below threshold
- Creates
coverage/coverage.infofor uploading to services
Use case: CI/CD - fail builds if coverage too low
./scripts/coverage-ci.sh # Requires 80% coverage
./scripts/coverage-ci.sh 70 # Requires 70% coverage
./scripts/coverage-ci.sh 90 # Requires 90% coverageExample output:
Line coverage: 85.2%
Threshold: 80%
✅ PASSED: Coverage 85.2% meets threshold 80%
These scripts make development faster by:
- Hiding complex CMake commands
- Providing consistent workflows
- Being easy to remember and type
- Similar to
npm runscripts you might be familiar with!