Quick Test CLI provides flexible configuration options for compilation commands, timeout limits, and language-specific settings.
Command options
All quicktest commands accept common configuration options that control test execution.
Test execution options
Number of test cases to generate and run. qt cmp -t main.cpp -c correct.cpp -g gen.cpp --test-cases=500
# Short form
qt cmp -t main.cpp -c correct.cpp -g gen.cpp --tc 500
Maximum execution time per test case in milliseconds. qt stress -t main.cpp -g gen.cpp --timeout=1000
# Short form
qt stress -t main.cpp -g gen.cpp --tout 1000
Set timeouts based on your problem’s time limit. For a 2-second time limit, use --tout 2000.
--memory-limit
number
default: "1000000000"
Maximum memory usage in bytes (default: 1GB). qt cmp -t main.cpp -c correct.cpp -g gen.cpp --memory-limit=512000000
# Short form (512MB)
qt cmp -t main.cpp -c correct.cpp -g gen.cpp --ml 512000000
Test case management
Saving test cases
Running saved test cases
Using static test cases
Control which test cases are saved to disk: # Save only failing test cases (WA, TLE, RTE)
qt cmp -t main.cpp -c correct.cpp -g gen.cpp --save-bad
# Save all test cases (AC and failures)
qt cmp -t main.cpp -c correct.cpp -g gen.cpp --save-all
Test cases are saved in .qt/testcases/ with the following structure: .qt/testcases/
├── testcase_wa_001.txt
├── testcase_wa_002.txt
├── testcase_tle_001.txt
└── testcase_ac_001.txt
Re-run specific categories of saved test cases: # Run only wrong answer cases
qt cmp -t main.cpp -c correct.cpp -g gen.cpp --run-wa
# Run only time limit exceeded cases
qt cmp -t main.cpp -c correct.cpp -g gen.cpp --run-tle
# Run only runtime error cases
qt cmp -t main.cpp -c correct.cpp -g gen.cpp --run-rte
# Run only accepted cases
qt cmp -t main.cpp -c correct.cpp -g gen.cpp --run-ac
# Run all saved test cases
qt cmp -t main.cpp -c correct.cpp -g gen.cpp --run-all
Use --run-wa to debug specific failing cases after fixing your code.
Test against pre-made test files instead of a generator: # Use test files with prefix "testcase_ac"
qt cmp -t main.cpp -c correct.cpp --prefix=test_cases/testcase_ac
# Short form
qt cmp -t main.cpp -c correct.cpp -p test_cases/testcase_ac
The --prefix option conflicts with --gen-file. Use one or the other, not both.
Execution control flags
Break on failure
Show differences
Save output
# Stop immediately when WA, TLE, or RTE occurs
qt cmp -t main.cpp -c correct.cpp -g gen.cpp --break-bad
# Short form
qt cmp -t main.cpp -c correct.cpp -g gen.cpp --break
Language configuration
Quick Test automatically detects your programming language based on file extensions and uses appropriate compilation commands.
Supported languages
Extensions : .cpp, .cc, .cxx, .c++, .hpp, .hh, .hxx, .h++Compilation command :g++ -std=c++17 -Wall -DONLINE_JUDGE=1 -o .qt/main main.cpp
Execution :The -DONLINE_JUDGE=1 flag is automatically added to match online judge environments.
Extensions : .pyExecution :No compilation step required.
Extensions : .javaCompilation command :Execution :Your main class must be named Main to match the expected execution pattern.
Extensions : .rsCompilation command :cp main.rs ~/.quicktest/rust/src/main.rs && \
cargo build --release --quiet --manifest-path ~/.quicktest/rust/Cargo.toml && \
cp ~/.quicktest/rust/target/release/rust .qt/main
Execution :Rust compilation uses a shared Cargo project in ~/.quicktest/rust/ with common dependencies:
proconio (input parsing)
num (numeric types)
rand (random generation)
regex (pattern matching)
num-bigint (big integers)
Extensions : .goCompilation command :cp main.go ~/.quicktest/go_mod/main.go && \
go build -buildmode=exe -o ./.qt/main ~/.quicktest/go_mod/main.go
Execution :
Extensions : .c, .hCompilation command :gcc -std=gnu11 -lm main.c -o .qt/main
Execution :The -lm flag links the math library automatically.
Extensions : .ktCompilation command :kotlinc main.kt -include-runtime -d .qt/main.jar
Execution :
Advanced configuration
Modifying C++ compilation settings
You can customize C++ compiler settings using the setup config command:
quicktest setup config --label=languages.cpp.compile --value= "g++ -std=c++20 -O2 -Wall -o .qt/main main.cpp"
Advanced configuration is currently limited. Future versions will support more customization options.
Environment-specific settings
Quick Test adapts compilation and execution commands based on your operating system:
Unix/Linux/macOS : Uses binary executables (.qt/main)
Windows : Adds .exe extension (.qt/main.exe)
Working directory structure
Quick Test creates a .qt/ directory in your working directory:
my-problem/
├── main.cpp
├── correct.cpp
├── gen.cpp
└── .qt/
├── main # Compiled target binary
├── correct # Compiled correct binary
├── gen # Compiled generator binary
├── input.txt # Current test case input
├── output.txt # Current test case output
└── testcases/ # Saved test cases
├── testcase_wa_001.txt
└── testcase_tle_001.txt
Add .qt/ to your .gitignore to avoid committing generated files.
Configuration examples
Competitive programming contest
Debug specific failures
Stress testing for TLE
Memory-intensive problems
# Fast iteration with immediate feedback
qt cmp -t main.cpp -c correct.cpp -g gen.cpp \
--tc 1000 \
--tout 1000 \
--break-bad \
--save-bad
Next steps
Examples See real-world configuration in action
Troubleshooting Fix configuration issues