Servus Codeforces,
I think many of you have already heard about stress testing, and many of you have your own scripts, etc., which may not always be convenient.
That’s why I present to you OHP, a convenient way to do stress testing.
Installation
wget https://github.com/waipoli/ohp/blob/master/ohp
However, I also recommend adding an alias to your bash/zsh/...rc afterwards.
Usage
To start, run ohp init
in your working directory.
A folder will appear:
Put the correct solution in correct.cpp
and the one you're testing in sol.cpp
.
Write a generator using testlib
in the gen.cpp
file.
For the checker, you need to use three inputs/outputs like this:
#include "checker_utils.h"
using namespace std;
/*
int a, b, c;
input >> a;
output_correct >> b;
output_sol >> c;
return AC;
return WA;
*/
int main() {
return 0;
}
If the checker finds the answer correct, return AC
; otherwise, return WA
.
Then run ohp compile
and ohp run -t={number_of_tests}
.
If it finds an incorrect test, it will display it to you, and you can find the test in the pipe
folder.
Thats it)
If you have any questions or suggestions, feel free to write them in the comments or create pull requests on GitHub.
And how to test interactive problems with your approach? Or problems with double-run of your solution? Script as simple as yours every polite coder already has. So pls add more functionality to it.
Yes, it will be added soon.