Handy script to generate Test Cases for HackerRank, HackerEarth and CodeChef Problems
Are you a Problem Author? The toughest part of creating a problem is creating tricky, correct and constrained Test Cases. Well, here is a handy Python Script, for your respective logic (solution).
The following languages are supported for testcase generation:
Clone the repository $ git clone https://github.com/aashutoshrathi/Testcase-Generator.git
$ virtualenv venv
(click here to read about activating virtualenv)
$ source ./venv/bin/activate
$ cd venv/Scripts/
$ activate
$ pip install -r requirements.txt
$ pip install -e .
tc_generator
$ cd tc_generator/
tc_gen.py
according to the input format you wish to generate $ python tc_gen.py
test-cases.zip
for HackerRank & HackerEarth and test-cases
directory for CodeChef.Tip: If you’re creating testcases for CodeChef then you can validate that the input sequence is generated according to the constraints using this validator file. 😉
docker build . --tag=tcgen
docker run -p 4000:80 tcgen
Testcase-Generator
$ cd Testcase-Generator/
$ pip install -r requirements.txt
$ pip install -e .
pytest
$ pytest
lang_compiler.py
to the line below will compile the file with C++ 17. You can replace the ‘17’ with ‘11’, ‘14’ or ‘20’ in the line below to compile with the respective versions.'compile': ['g++', f'{CMD}.cpp', '-o', CMD, '-std=c++17']},
Thanks goes to these wonderful people (emoji key):
Aashutosh Rathi 🔧 📆 👀 🐛 💻 |
Pushkar Patel 🚧 ⚠️ 🐛 💻 |
Pritha Upadhyay 🚧 ⚠️ 🐛 💻 |
Vishnu Ramana 📖 |
Tim Rossback 📖 |
Sasivarnan R 📖 |
Gerardo Gálvez 💻 |
Dastgir 📖 |
Sai Adarsh S 📖 |
Rounak Agarwal 💻 📝 |
This project follows the all-contributors specification. Contributions of any kind welcome!
Made with ❤ by Aashutosh Rathi