@@ -10,6 +10,10 @@ To run these testcases, copy the content of the [testcases](testcases) folder in
...
@@ -10,6 +10,10 @@ To run these testcases, copy the content of the [testcases](testcases) folder in
The new testcases will appear in the Testreport when you run `make test`.
The new testcases will appear in the Testreport when you run `make test`.
## Debugging
To debug these testcases you can run your program with the right configs and then you can just copy the whole content of input.txt of the corresponding testcase into your console.
### Debugging random number generation
### Debugging random number generation
To test random numbers better, some testcases include prints of how random numbers are generated, like this:
To test random numbers better, some testcases include prints of how random numbers are generated, like this:
NOTE: This command should be executed in the tc-maker directory. Also, you may NEVER press backspace (löschen) as it messes the output up.
NOTE: This command should be executed in the tc-maker directory. Also, you may NEVER press backspace (löschen) as it messes the output up.
This will then create a file called `output.txt` with the output of your program. After that, we need to bring the output into the correct format. For that, I created a python script [format.py](tc-maker/format.py). You can run it with `python3 format.py` in the tc-maker directory. This will create a new file `io.txt` with the correct format. There are example files for `output.txt` and `io.txt` to get an idea of what it should look like.
This will then create a file called `output.txt` with the output of your program. After that, we need to bring the output into the correct format. For that, I created a python script [format.py](tc-maker/format.py). You can run it with `python3 format.py` in the tc-maker directory. This will create 2 new files`io.txt`and `input.txt`with the correct format. There are example files for `output.txt`, `io.txt` and `input.txt`to get an idea of what it should look like.
Now you can move the `io.txt` file into the correct folder (e.g. `testcases/tests/19/`) and add the testcase to the `test.toml` file (just copy and paste an existing testcase and change the number+description).
Now you can move the `io.txt`and `input.txt`files into the correct folder (e.g. `testcases/tests/19/`) and add the testcase to the `test.toml` file (just copy and paste an existing testcase and change the number+description).