Skip to main content
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

--test-cases
number
default:"1000"
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
--timeout
number
default:"2000"
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

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

Execution control flags

# 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:
./.qt/main
The -DONLINE_JUDGE=1 flag is automatically added to match online judge environments.
Extensions: .pyExecution:
python main.py
No compilation step required.
Extensions: .javaCompilation command:
javac -d .qt/ Main.java
Execution:
java -cp .qt/ Main
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:
./.qt/main
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:
./.qt/main
Extensions: .c, .hCompilation command:
gcc -std=gnu11 -lm main.c -o .qt/main
Execution:
./.qt/main
The -lm flag links the math library automatically.
Extensions: .ktCompilation command:
kotlinc main.kt -include-runtime -d .qt/main.jar
Execution:
java -jar .qt/main.jar

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

# 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

Build docs developers (and LLMs) love