Running tests
Basic test commands
Run all tests usingjust or meson:
Test commands reference
| Command | Description |
|---|---|
just test | Run all tests |
just test-verbose | Run tests with verbose output |
just test-one NAME | Run a specific test by name |
meson test -C build -v | Run tests with verbose output (Meson) |
meson test -C build --suite unit | Run only unit tests |
Running specific tests
To run a specific test:Test output
Successful test output
Failed test output
When tests fail, Meson provides details:Writing tests
Test structure
Tests in Draconis++ follow this general structure:Testing Result types
When testing functions that returnResult<T>:
Testing Option types
When testing functions that returnOption<T>:
Test best practices
1. Test both success and failure paths
2. Validate error messages
3. Test edge cases
4. Clean up resources
Platform-specific testing
Conditional tests
Some features are platform-specific:Testing optional features
Test features that depend on build configuration:Integration tests
Integration tests verify that components work together:Continuous integration
Tests are automatically run on:- Every pull request
- Every commit to main branch
- Multiple platforms (Windows, Linux, macOS)
- Multiple compilers (GCC, Clang, MSVC)
Debugging test failures
View detailed test output
Run tests under debugger
Check test logs
Meson saves test logs inbuild/meson-logs/testlog.txt:
Test coverage
When adding new features:- Add tests for all public APIs
- Test success and failure paths
- Test edge cases and boundary conditions
- Add platform-specific tests when needed
- Verify tests pass on all platforms
Before submitting
Before submitting a pull request:Next steps
Contributing overview
Review the complete contribution workflow
Code style
Learn about code style guidelines