This example demonstrates the basic usage of testcoe to enhance your Google Test output with a visual grid display.
main.cpp- Main program that initializes testcoe and runs the testsmath_tests.cpp- Test cases for mathematical operationsstring_tests.cpp- Test cases for string operationsvector_tests.cpp- Test cases for vector operations
# Build the example with CMake
mkdir -p build
cd build
cmake ..
cmake --build .# Run all tests
./basic_example
# Or use the CMake target
cmake --build . --target run_basic_example- testcoe is initialized with
testcoe::init(&argc, argv), replacing the usual Google Test initialization. - Tests are run with
testcoe::run(), replacing the usualRUN_ALL_TESTS(). - The grid visualization shows all test suites and their status in real-time.
- An intentional failure is included to demonstrate how failures are displayed.
You should see a grid display showing the progress of all test suites (MathTest, StringTest, VectorTest) with color-coded status indicators:
.- Not run yetR- Currently runningP- PassedF- Failed
When all tests complete, a summary will show the total number of tests, passes, and failures.