Windows and Linux Users
Strees Testing is very important for every competitive programming to know if your code is accurated 100% or not, and if you want to know if it will be passed in the time limit or will exceeded it
You can Use it to test your code if it will passed in the time or will get TLE
.
Install python3
Download this repository manually or by using git clone on terminal.
Copy your original solution which you expect might fail in the file Test.cpp
.
Copy your brute force solution which is expected to give correct output in the file Correct.cpp
.
Change the Generated.cpp
file so as to generate test cases according to the question.
Generated.cpp
will export the test cases to the input.txt
file
You can run Strees.py
from the terminal or you can run with vscode or any IDE
The script will ask you to enter the number of testcases
Output:
The output of running file Strees.py
on every test case is either Accepted
if your solution's output matches the brute solution output or Wrong Answer
and will show the input on which the solution failed, the output of your solution and expected output according to the brute force solution on terminal and the script will be terminated. Now you can debug your original solution and check where it goes wrong.
If you wish to terminate the script at any moment you wish use the command ctrl + c
in your terminal.
The script will ask you to enter the time limit in seconds
and the script will terminate if your solution will exceed the time limit
The script will ask you if you want to use a custom checker, if you want to use a custom checker you can write your checker in the file Checker.cpp
and the script will use it to check your solution output, if you want to use the default checker just press Enter
and the script will use the default checker
Quick Demo: below the solution fails on randomly generated test #3:
Linux Users Only
Strees Testing is very important for every competitive programming to know if your code is accurated 100% or not, and if you want to know if it will be passed in the time limit or will exceeded it
Download this repository manually or by using git clone on terminal.
Copy your original solution which you expect might fail in the file Test.cpp
.
Copy your brute force solution which is expected to give correct output in the file Correct.cpp
.
Change the Generated.cpp
file so as to generate test cases according to the question.
Generated.cpp
will export the test cases to the input.txt
file
You can run Strees.sh
from the terminal or you can run with vscode or any IDE
You can open Strees.sh
an choose the number of test cases by editing the line 21
Output:
The output of running file Strees.sh
on every test case is either Accepted
if your solution's output matches the brute solution output or Wrong Answer
and will show the input on which the solution failed, the output of your solution and expected output according to the brute force solution on terminal and the script will be terminated. Now you can debug your original solution and check where it goes wrong.
If you wish to terminate the script at any moment you wish use the command ctrl + c
in your terminal.
We will install notify-send to send to us notification with accepted or wrong answer
sudo apt-get install notify-osd
Quick Demo: below the solution fails on randomly generated test #10:
Linux Users Only
Copy your solution which you want to check about his time to Test.cpp
.
Change the Generated.cpp
file so as to generate test cases according to the question.
You can run Time.sh
from the terminal or you can run with vscode or any IDE
You can open Time.sh
an choose the number of test cases by editing the line 10
The Time.sh
will excecute Test.cpp
the number of times you want and print you the time that your code take and each time with distinct test
Quick Demo: below the solution times on randomly generated test:
If you will use Generator.cpp
file, these information will help you to use it.
- Choose number of file you want to print in line
134
- Choose number of test cases in each file from line
131
- If your problem has a single test case uncomment line
130
there are many functions to help you to generate test like:
-
gen_string
- generate a string
Upper Case
orLower Case
and in any range you want with your length
- generate a string
-
gen_string_u_and_l
- generate a string
Upper Case
andLower Case
and in any range you want with your length
- generate a string
-
gen_int
- generate a integer number in the range you want from
L
toR
- generate a integer number in the range you want from
-
gen_palindrome
- generate a palindrome string with your length in the range that you want
-
gen_array
- generate an array with your size and in range you want, you can make the array
normal
orincreasing
ordecreasing
- generate an array with your size and in range you want, you can make the array
-
gen_array_2D
- generate an array_2D with your size and in range you want.
-
gen_permutation
- generate an array with a permutation of
N
- generate an array with a permutation of
-
gen_bit_int
- generate a string with your length consit of digit in the range that you want
-
gen_array_of_pairs
- generate an array of pairs with your length in the range that you want, you can choose if the pair is interval or not.
-
gen_char
- gen character in range that you want
-
gen_tree
- generate a tree or
bamboo
like tree orstar
like tree
- generate a tree or
-
gen_graph
- generate a simple graph
The test cases files will exported in Tests
folder in the same directory of the Generator.cpp
file