A stress testing batch script with a simple batch script to generate multiple test cases in a matter of seconds .
- I only used this in Windows.
-
You have to prepare 3 other programs along with this script. Those are, your original solution (
solution.cpp), the bruteforce/correct solution (brute.cpp), and the randomized input generator (gen.cpp). -
Have them all in the same directory.
-
Open your command prompt there.
-
Do one of the following depending on your needs:
- Compile the 3 programs and stress test the solution on 100 randomized test cases:
> stress- Compile the 3 programs and stress test the solution on
nrandomized test cases:
> stress [n]- Stress test the solution on
nrandomized test cases without compiling the 3 programs:
> stress [n] 0
-
You have to prepare 2 other programs along with this script. Those are, the randomized input generator (
gen.cpp), and the solution (solution.cpp). -
Have them all in the same folder/directory.
-
Open your command prompt there.
-
Do one of the following depending on your needs:
- Generate 10 test cases (input and output), starting from test case #1
> gen_tc- Generate
ntest cases (input and output), starting from test case #1
> gen_tc [n]- Generate
ntest cases (input and output), starting from test case #k
> gen_tc [n] [k]
Generate 15 test cases, starting from test case #6 :
> gen_tc 15 6
This will generate 15 input and output files (30 in total) like this :
your_folder
L input6.txt
L output6.txt
L input7.txt
L output7.txt
...
L input20.txt
L output20.txt