A lightweight, easy to customize contest parser and pretests runner
During programming contest of stringent time limits, even few seconds matter. It is time consuming to copy past test cases and execute the code on local again and again.
Using this tool in a 2-word command (parse_contest X) it will download and create a folder structure with all the pretests (Sample Testcases) for that programming contest.
Also using a 2-word (test Y) command it will execute all pretests for any problem.
In other words it will remove all manual effort in copy pasting inputs and comparing outputs for all pretests (Sample Testcases).
Step-1: Navigate to the project folder.
Step-2: run command: [sample command : parse_contest 1427 ] :
It will create directory structure like below: (with cpp files generated using template in ref folder)
└───1427 │ A.cpp │ B.cpp └───pretests ├───A │ input_0.txt │ output_0.txt │ └───B input_0.txt input_1.txt input_2.txt input_3.txt output_0.txt output_1.txt output_2.txt output_3.txt
Step-3: Running testcases: [sample command : test B ]
> test B ------------------------------ pretest - 0: PASSED 6 ac?b?c 24 24 ------------------------------ pretest - 1: PASSED 7 ??????? 2835 2835 ------------------------------ pretest - 2: PASSED 9 cccbbbaaa 0 0 ------------------------------ pretest - 3: Failed 4 ???? 12 13
Entity | Color |
---|---|
Pretest Status | Green if success else Red |
Pretest Input | Yellow |
Expected Output | White |
Programs Output | Green if success else Red |
- Calls parse_contest.py and change directory to current folder
- Fetch contest details from contest page and get all problems list
- fetchs pretests by starting new thread for each problem page
- generates apropriate directory tree
- Template cpp file
- Compile and Run Cpp
- Compile only if executable is modified before the code
- calls test_script.py with problem
- script to execute all pretests one by one for given problem