This example demonstrates how to use testcoe's test filtering capabilities to run specific test suites or individual tests.
main.cpp- Main program that initializes testcoe and handles test filteringtest_suites.cpp- Multiple test suites for demonstration
# Build using CMake
mkdir -p build
cd build
cmake ..
cmake --build ../examples/filter/filter_example --all./examples/filter/filter_example --suite=MathSuite./examples/filter/filter_example --test=StringSuite.Length./examples/filter/filter_example --helpThe example contains three test suites:
-
MathSuite - Basic mathematical operations:
- Addition
- Subtraction
- Multiplication
- Division
-
StringSuite - String operations:
- Length
- Concatenation
- Comparison
-
VectorSuite - Vector operations:
- Size
- PushBack
- Clear
-
testcoe provides a simple API for running specific tests:
testcoe::run()- Run all teststestcoe::run_suite("SuiteName")- Run a specific test suitetestcoe::run_test("SuiteName", "TestName")- Run a specific test
-
This example demonstrates how to build a command-line interface around these methods
-
The grid visualization adapts to show only the tests that are being run