diff --git a/AGENTS.md b/AGENTS.md index decebbd..4bbd95f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -43,10 +43,15 @@ ## Common Commands - Build: make -- Test: make test -- Test (with extra debug info): ./orbit_test -s '[config_name]' +- Test (build + run all): make test +- Test (rebuild only): make test-build +- Test (specific tag): ./build/orbit_test '[tag_name]' +- Test (with debug output): ./build/orbit_test -s '[tag_name]' - needed to display 'INFO' statements for successful tests with Catch2 framework -- See README.md for full build instructions +- See docs/technical_reference.md for full build target reference + +## Simulation +The simulation binary is built at `./build/orbit_sim`. Agents should NOT attempt to run the graphical simulation. Focus on testing and code changes only. ## Testing Guidelines - Always use `WithinAbs()` for floating-point comparisons diff --git a/Makefile b/Makefile index e0d2ff0..ba7cc6a 100644 --- a/Makefile +++ b/Makefile @@ -64,10 +64,6 @@ clean-all: clean # Rebuild rebuild: clean all -# Run the simulation -run: $(TARGET) - ./$(TARGET) - $(TEST_OBJECTS): $(BUILD_DIR)/%.o : $(TEST_DIR)/%.cpp $(CXX) $(CXXFLAGS) -c $< -o $@ @@ -88,4 +84,4 @@ test-build: $(BUILD_DIR) $(C_OBJECTS) $(CPP_OBJECTS) $(TEST_OBJECTS) test: test-build ./$(TEST_TARGET) -.PHONY: all clean clean-all rebuild run test test-build raylib ctags +.PHONY: all clean clean-all rebuild test test-build raylib ctags diff --git a/docs/technical_reference.md b/docs/technical_reference.md index b7b49c2..c00ab18 100644 --- a/docs/technical_reference.md +++ b/docs/technical_reference.md @@ -249,17 +249,40 @@ All satisfy vis-viva: v² = μ(2/r - 1/a). ## Build System -**Targets**: make, make all, make raylib, make run, make test, make test-build, make clean, make rebuild. +**Targets**: make / make all (build + ctags), make raylib, make test, make test-build, make clean, make clean-all, make rebuild. **Dependencies**: g++ (C++14), raylib (git submodule), raygui (header-only), tomlc17, Catch2 (tests only). **Testing**: ```bash -make test # Run all tests -./orbit_test '[config_name]' # Run specific config -./orbit_test -s '[config]' # With debug output +make test # Build and run all tests +make test-build # Rebuild test executable only ``` +### Running Specific Tests + +The test binary is at `./build/orbit_test`. Catch2 v3.7.1 supports multiple filtering strategies: + +```bash +./build/orbit_test '[analytical]' # By tag +./build/orbit_test "*barker*" # By name (wildcard) +./build/orbit_test '*burn*' [hybrid] # Combined: name AND tag +./build/orbit_test '[hohmann]~[energy]' # Exclude tag (~) +./build/orbit_test -s '[tag]' # With debug/INFO output +``` + +Tags are the most common filter. Multiple tags on the command line use AND logic (test must have all tags). The `~` operator excludes a tag. + +### SCENARIO Sections + +SCENARIO tests group related assertions under SECTION sub-tests. Each SECTION is an independent test case — setup code before all SECTIONs runs once per SECTION, so fixtures are recreated. This allows drilling into specific parts: + +```bash +./build/orbit_test '[hohmann]' --section "First burn at perigee raises apogee" +``` + +In `--list-tests` output, SCENARIO tests display with "Scenario: " prefix. When filtering by name, wildcards handle the prefix transparently. + Use `WithinAbs(expected, tolerance)` for floating-point comparisons (NOT `Approx()`). ## Hybrid Documentation Strategy