Simple module to help testing programming contest exercises.
It aims to help me resolve some problems I have with online platforms:
- you have to be online
- if the platform disappears you lost your work
- if you use multiple platforms the problems you solved are not centralized
- you can't manage personal problems you've taken from book or other sources
Create your problem solution by first creating a folder like the one present in the samples folder.
─ helloworld
├── 0_in.txt
├── 0_out.txt
├── 0_res.txt
├── 1_in.txt
├── 1_out.txt
├── 1_res.txt
├── helloworld.py
├── __init__.py
└── test_helloworld.py
The helloworld.py file contains your problem solution
w = input()
print("hello " + w + "!")The test_helloworld.py_ simply contains:
from judge_offline import *
tests = create_test_class('samples.helloworld')A test is described via 3 files:
- input which is given to the standard input to the solution. Must be suffixed with _in.txt
- output which is produced by the solution. Must be suffixed by _out.txt
- result which contains expected result. Must be suffixed by _res.txt
Simply run the unit test to run all tests described into files.
When a test fails the diff between expect result file and output file is shown (up to a fixed limit).
python setup.py install