Run all test cases available for a problem with a single command. For ENGG1340/COMP2113 students (22-23 spring).
Avoid the hassle of running each test case one by one and comparing the output with the expected output. This script does it all for you.
Any shell
Tested to work on
zsh 5.9 (x86_64-apple-darwin23.0)
Should work on bash shell too
-
Download
check.sh
sync.sh
and put them in the folder containing all your assignments. The folder structure should look like this:folder-containing-all-assignments ├── A1_files │ ├── Q1 │ ├── Q2 │ └── Q3 ├── A2_files │ ├── Q1 │ ├── Q2 │ └── Q3 ├── A3_files │ ├── Q1 │ └── Q2 ├── check.sh <- here └── sync.sh <- here
Via
curl
(navigate to folder-containing-all-assignments first):curl -o check.sh https://raw.githubusercontent.com/kennethkn/check1340/main/check.sh curl -o sync.sh https://raw.githubusercontent.com/kennethkn/check1340/main/sync.sh
-
Grant permissions with:
chmod u+x check.sh chmod u+x sync.sh
-
Run
sync.sh
to deploycheck.sh
to every problem folder./sync.sh
-
For programs that use arguments for input, enter the arguments for each test case accordingly in
check.sh
, as demostrated below:args=( "abc t1.txt t2.txt t3.txt" # arguments for test case 1 "ab t1.txt t2.txt t3.txt" # arguments for test case 2 "he t3.txt t4.txt t5.txt" # arguments for test case 3 ... )
./check.sh [-v]
-v OPTIONAL. Show the output of diff.
Feel free to contribute by opening an issue or a pull request.
Fun fact: This is my first ever repo!