Run your C++ solution against sample tests in one click, with a live results panel inside VS Code. Built for competitive programming and contest practice.
Features
Compiles the active .cpp file with g++ and runs it on every saved sample
Clear verdicts per test: PASS, FAIL, TLE (time limit exceeded), RE (runtime error)
Side-by-side expected vs actual output, with differing lines highlighted
Add, edit, and delete samples directly in the results panel
Compile errors shown in full, so you can fix them without leaving the editor
Samples are stored as plain files next to your solution, so they are easy to keep in Git
Windows line endings and trailing whitespace never cause false failures
Requirements
g++ available on your PATH
Windows: install MinGW-w64 or MSYS2 and add its bin folder to PATH
macOS:xcode-select --install
Linux: install g++ from your package manager
Usage
Open a .cpp file.
Run CP Test Runner: Run Against Samples from the Command Palette (or press Ctrl+Alt+R).
The first time, an empty test is created. Fill in the input and expected output in the panel.
Press Run. Use Add test and Delete to manage your samples.
How samples are stored
For solution.cpp, samples live in a solution.tests/ folder beside it: