| Crates.io | code-tester |
| lib.rs | code-tester |
| version | 0.1.0-base.2 |
| created_at | 2025-06-26 00:47:39.507456+00 |
| updated_at | 2025-06-26 00:47:39.507456+00 |
| description | A tool to test if the algorithm is right. |
| homepage | https://github.com/weiwei-cool/code-tester |
| repository | https://github.com/weiwei-cool/code-tester |
| max_upload_size | |
| id | 1726737 |
| size | 55,586 |
code-tester is a Rust-based algorithm validation tool that automates testing to help developers verify algorithm correctness and performance. It supports single-case testing, batch testing, and runtime limits.
cargo install code-tester
Direct download available
test CommandValidates algorithm correctness and performance.
Syntax:
code-tester test [OPTIONS] <FILE>
| Argument | Type | Description |
|---|---|---|
<FILE> |
Required | Path to the algorithm executable |
| Option | Shortcut | Type | Description |
|---|---|---|---|
--input-file |
-i |
File Path | Specify input file path |
--ans-file |
-a |
File Path | Reference answer/output file |
--time-limit |
-t |
Number (ms) | Maximum execution time in milliseconds |
--data |
-d |
Path | Test case directory/archive (supports .in/.ans pairs, folders, or ZIP files) |
--no-input |
- | Flag | Indicates no input required |
# Test my_algo with input/answer files and 200ms timeout
code-tester test my_algo --input-file input.txt --ans-file answer.txt --time-limit 200
# Use test directory (must contain test_cases1.in/test_cases1.ans etc.)
code-tester test my_algo --data test_cases/
# ZIP file support
code-tester test my_algo --data examples.zip
# For input-free algorithms
code-tester test my_algo --no-input --ans-file answer.txt
--time-limit uses milliseconds (e.g., 200ms = 0.2s)--no-input cannot coexist with --input-fileexample<number>.in and example<number>.ans filesa/a1.in + a/a1.ansb.zip/b1.in + b.zip/b1.ansa/b1.in (folder-name mismatch)test/test.in (missing numeric index)code-tester --version
# Build from source
git clone https://github.com/weiwei-cool/code-tester
cd code-tester
cargo build --release
We welcome PRs! Follow semantic versioning and include test cases for new features.
MIT License