You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This project uses a comprehensive testing strategy with 118 unit tests across 11 test suites, achieving 92.31% line coverage and 95.96% region coverage.
Simulation (test_simulation.cpp) - Full simulation stepping with predator-prey dynamics
Configuration (test_config.cpp) - YAML loading and parameter sweep generation
Experiment (test_experiment.cpp) - CSV output and metric recording
Running Tests
# Run all tests
make test# Run specific test suite
./test_runner --gtest_filter="PreyTest.*"# Run specific test
./test_runner --gtest_filter="PreyTest.FleeScalesWithProximity"# List all available tests
./test_runner --gtest_list_tests
# Generate coverage report
make coverage
open build/coverage/html/index.html
# Install vcpkg first: https://vcpkg.io/
vcpkg install gtest yaml-cpp glew glfw3
# Use Visual Studio or WSL2 with Ubuntu instructions above
Docker (Recommended for Cross-Platform)
The easiest way to build and test on any platform is using Docker.
Quick Start
# Run all tests
docker compose run --rm test# Run tests with coverage (outputs to ./coverage-report/)
docker compose run --rm coverage
# Run experiments (outputs to ./output/)
docker compose run --rm experiment
Manual Docker Commands
# Build the test image
docker build --target test -t boid-sim:test .# Run tests
docker run --rm boid-sim:test
# Build and run with custom config
docker build --target experiment -t boid-sim:experiment .
docker run --rm -v $(pwd)/output:/app/output -v $(pwd)/config:/app/config:ro \
boid-sim:experiment config/sweep.yaml output/sweep_results.csv
Building Natively in Docker
# Start interactive container
docker run --rm -it -v $(pwd):/app -w /app ubuntu:24.04 bash
# Inside container: install deps and build
apt-get update && apt-get install -y build-essential clang libc++-dev ...
cp makefile.docker makefile
make test
Platform-Specific Notes
macOS
Uses the default makefile with Homebrew paths
OpenGL via -framework OpenGL
Linux
Use makefile.docker or modify paths in main makefile
OpenGL via -lGL
May need to build Google Test from sources
Windows
Recommended: Use WSL2 with Ubuntu and follow Linux instructions