vrun-0.1.3 is not a library.
vrun
A CLI tool for competitive programmers that:
- Receives test cases directly from your browser via Competitive Companion
- Compiles your C++ solution and runs it against those test cases
- Reports each test as AC or WA, with a diff of expected vs actual output on failure
- Stress tests your solution against a brute-checker using a generator to find failing cases
- Supports interactive mode for manual debugging
Installation
Prerequisites
- Rust Toolchain: Install Rust via rustup:
| - C++ Compiler: Ensure
g++is installed and available in yourPATH.
Installation
cargo install vrun
Usage
1. Ingesting Testcases
Start the listener to receive testcases directly from your browser:
Note: Make sure Competitive Companion is configured to send requests to port 10045 (the default for this tool).
2. Running a Solution
Test your solution against testcases from various sources (discovery order):
testcases/subfolder - looks for{Problem}_input*.txt/{Problem}_output*.txtinside atestcases/directory (compatible with the Competitest Neovim plugin).- Alongside the source file - if
testcases/yields nothing, looks for the same file pattern in the same directory as the source. - CPH VS Code Extension - auto-detects
.cph/*.probfiles. - Custom input file:
Basic usage:
If your testcases are in a non-standard location, specify it explicitly: vrun run solution.cpp --source-dir ~/custom_path.
3. Stress Testing
To find failing cases for your solution by comparing it to a brute-force approach using a generator:
This will automatically use the parent directory of your solution as the base for storing temporary files and looking for testcases.
4. Interactive Mode
If you need to manually debug or provide input:
Quick Examples
# run solution
# verbose run
# custom input
# interactive (waits for input)
# stress test
# listen for Competitive Companion
License
Apache License 2.0