How to Generate Test Cases Using Polygon
Step 1:
Download testlib
You will have 4 folders and 1 file, one folder is "Generator", it will contain 6 cpp files, each file generates a different kind of input, if you open any file you will know what kind of input it generates.
Step 2:
On polygon, after you finish writing your problem, click on "Files" at the upper bar. at Resource files, click "Add File", select the file "testlib.h" from your hard disk and click "Add".
Step 3:
Then, at Source files, click "Add File", and you should select the suitable cpp file for your problem from the folder "Generators" on your hard disk, and click "Add".
Now you are ready to generate your test cases.
Step 4:
Select "Tests" from the upper bar, you will find an empty text box written upon it "Script". in this text box you will call your generator with different parameters to generate different values.
Example: if you are using "sgen", then your script will be like this:
sgen 1 > $
sgen 2 > $
sgen 5 > $
sgen 8 > $
(Each dollar signs will be automatically replaced with the smallest available test index)
Step 5:
Save script and select "Invocations" from the upper bar, select "Want to run solutions?" to check for the generated test cases.
And you are done.