This repository hosts the code for cptool, a tool to "automate" cpp tests for competitive programming
Clone the repository to the path you want, then there are several ways to run it:
-
Use
python cptool <filename>
without the .cpp file extension, cptool will take care of compiling and testing your code. Make sure you have the test.txt file with the answer to your program, you can use the codeforces examples. -
Use
chmod +x
to make the file executable, then just do cptool , remember that every time you do this if cptool is not in the same folder you want to use it in you have to provide the path where it is located. -
The last way is to do
chmod +x
but move the executable to the/usr/local/bin
folder so you can run cptool from anywhere, if you want you can run themake.sh
file (with sudo) to do this for you.
Then if you want to try the tool you can execute the tool in the example directory.
Don't forget to have the preprocessor directive to receive inputs and write the program output to a file:
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif