Test case generator + output comparator
Overview
A tool to generate test-cases for competitive programming. With it, you can also execute your code on generated test-cases and compare it with other code automatically. * Generate random test-cases * Auto-generate .tcs syntax files from problem statements using the testcase-syntax skill * Run code (supports C11, C++14, Python 3) automatically on these test-cases * Run two codes simultaneously and compare results to detect corner cases * Generate HackerRank problem-setting style test-case zip packages * Solely for generating test-cases * To verify code runs properly and avoid runtime errors * To compare optimized code against brute-force code on random inputs To generate test-cases (E.g.: 5 test-cases): To generate test-cases and run your code on them: To generate test-cases, run two codes, and compare output: To generate HackerRank style test-cases zip: - Default -N is 10. Pass -N to adjust. - Default config is configs/default.ini. Use -C to specify custom config. - Pass .
README
CP-test
A tool to generate test-cases for competitive programming. With it, you can also execute your code on generated test-cases and compare it with other code automatically.
What it can do?
- Generate random test-cases
- Auto-generate
.tcssyntax files from problem statements using the testcase-syntax skill - Run code (supports C11, C++14, Python 3) automatically on these test-cases
- Run two codes simultaneously and compare results to detect corner cases
- Generate HackerRank problem-setting style test-case zip packages
Why?
- Solely for generating test-cases
- To verify code runs properly and avoid runtime errors
- To compare optimized code against brute-force code on random inputs
Usage
To generate test-cases (E.g.: 5 test-cases):
python3 testcode.py -T testcase_syntax.tcs -N 5
To generate test-cases and run your code on them:
python3 testcode.py -T testcase_syntax.tcs -I1 my_code.cpp
To generate test-cases, run two codes, and compare output:
python3 testcode.py -T testcase_syntax.tcs -I1 my_code.cpp -I2 my_bruteforce.py
To generate HackerRank style test-cases zip:
python3 testcode.py -T testcase_syntax.tcs -I1 my_code.cpp -C configs/hackerrank.ini
- Default
-Nis 10. Pass-Nto adjust. - Default config is
configs/default.ini. Use-Cto specify custom config. - Pass
.tcssyntax file with-T. Refer to TCSYNTAX.md for reference. - Skill: Use
skills/testcase-syntax/SKILL.mdto automatically translate problem statements and constraints into.tcsfiles. - See
AGENTS.mdfor AI agent testing guidelines and workflows.
Supported languages
- C11
- C++14
- Python3
Recommended Tools
Try a different keyword or remove a filter.
Install
npx skillfish add ccd97/cp-test