Commit 25df1e9b authored by Johannes Bechberger's avatar Johannes Bechberger

Update README

parent 4106580c
...@@ -11,15 +11,16 @@ __Semantic test cases that are executable (and terminate) should be placed in th ...@@ -11,15 +11,16 @@ __Semantic test cases that are executable (and terminate) should be placed in th
__Exec test cases can now use the import statement to import other classes. See the exec test case folder and the `preproc` folder for more information__ __Exec test cases can now use the import statement to import other classes. See the exec test case folder and the `preproc` folder for more information__
*There's also some other additional code in this repo, that might provide fuzzing capabilities. Please consider contributing *There's also some other additional code in this repo, that might provide fuzzing capabilities. Please consider contributing such code as it probably helps the other teams (and could later be integrated into a bigger test suite).*
such code as it probably helps the other teams (and could later be integrated into a bigger test suite).*
**The test cases should be committed in the [mjtest-tests](https://git.scc.kit.edu/IPDSnelting/mjtest-tests) repository**
Test modes Test modes
---------- ----------
The test cases are divided in 6 'modes': The test cases are divided in 6 'modes':
- __lexer__: Test cases that check the lexed token (and their correct output) - __lexer__: Test cases that check the lexed token (and their correct output)
- __syntax__: Test cases that just check whether `./run --parsecheck` accepts as correct or rejects - __syntax__: Test cases that just check whether `./run --parsecheck` accepts as correct or rejects
them. them.
- __ast__: Test cases that check the generated ast by using the pretty printing functionality. - __ast__: Test cases that check the generated ast by using the pretty printing functionality.
- __semantic__: Test cases that check semantic checking of MiniJava programs - __semantic__: Test cases that check semantic checking of MiniJava programs
- __compile-firm__: Test cases that check the correct compilation and execution of MiniJava programs with the libfirm backend. - __compile-firm__: Test cases that check the correct compilation and execution of MiniJava programs with the libfirm backend.
...@@ -80,8 +81,9 @@ Test types for the ast mode ...@@ -80,8 +81,9 @@ Test types for the ast mode
<td>Pretty printing the source file should result in the same output as pretty printing the already pretty printed file.</td> <td>Pretty printing the source file should result in the same output as pretty printing the already pretty printed file.</td>
</tr> </tr>
</table> </table>
_It uses all syntax mode tests implicitly._
It uses all syntax mode tests implicitly. Place the test files in the folder `ast`. Might not be all that useful, wasn't used at all in the two years ago.
Test types for the semantic mode Test types for the semantic mode
...@@ -99,7 +101,7 @@ Test types for the semantic mode ...@@ -99,7 +101,7 @@ Test types for the semantic mode
</tr> </tr>
</table> </table>
__All semantic mode tests have to be syntactically correct___ __All semantic mode tests have to be syntactically correct__
Test types for the compile-firm and compile mode Test types for the compile-firm and compile mode
...@@ -127,11 +129,17 @@ Test types for the compile-firm and compile mode ...@@ -127,11 +129,17 @@ Test types for the compile-firm and compile mode
<td><code>.invalid.mj</code> <code>.invalid.java</code></td> <td><code>.invalid.mj</code> <code>.invalid.java</code></td>
<td>The test file should compile. The execution of the resulting binary should abort width a return code <code>&gt; 0</code></td> <td>The test file should compile. The execution of the resulting binary should abort width a return code <code>&gt; 0</code></td>
</tr> </tr>
<tr>
<td><code>.inf.mj</code> <code>.inf.java</code></td>
<td>The test file should run longer than the specified timeout. This causes long test run-times.</td>
</tr>
</table> </table>
__All compile-firm and compile mode tests have to be semantically correct__ The test cases should be placed into the `exec` folder.
__All compile-firm and compile mode tests have to be semantically correct.__
__All bigger test cases (e.g. for benchmarking) should be placed into the `big` folder__ __All bigger test cases (e.g. for benchmarking) should be placed into the `big` folder.__
Test runner Test runner
...@@ -147,8 +155,9 @@ The following programs are required (and executable by simply calling their name ...@@ -147,8 +155,9 @@ The following programs are required (and executable by simply calling their name
Just clone this repository and you're done: Just clone this repository and you're done:
```sh ```sh
git clone https://github.com/mj3-16/mjtest git clone git@git.scc.kit.edu:IPDSnelting/mjtest.git
cd mjtest cd mjtest
git submodule update --init
``` ```
To get colored output install the python3 module `termcolor`. To get colored output install the python3 module `termcolor`.
...@@ -157,7 +166,7 @@ To get colored output install the python3 module `termcolor`. ...@@ -157,7 +166,7 @@ To get colored output install the python3 module `termcolor`.
### Usage ### Usage
Output of the `./mjt.py --help` Output of the `./mjt.py --help`
``` ```sh
usage: mjt.py [-h] [--only_incorrect_tests] [--all_exec_tests] usage: mjt.py [-h] [--only_incorrect_tests] [--all_exec_tests]
[--produce_no_reports] [--produce_all_reports] [--parallel] [--produce_no_reports] [--produce_all_reports] [--parallel]
[--output_no_incorrect_reports] [--color] [--ci_testing] [--output_no_incorrect_reports] [--color] [--ci_testing]
...@@ -198,6 +207,8 @@ optional arguments: ...@@ -198,6 +207,8 @@ optional arguments:
For Windows users: Using environment variables doesn't work and you have to use prefix `./mjt.py` with `python`. For Windows users: Using environment variables doesn't work and you have to use prefix `./mjt.py` with `python`.
The timeout for the execution of normal programs in seconds can be set via the environment variable `MJ_TIMEOUT` (default is `10`) and for `big` programs via `MJ_BIG_TIMEOUT` (default is `60`).
### Example usage ### Example usage
Assuming you want to run the syntax tests and your MiniJava base folder is `~/code/mj` then run Assuming you want to run the syntax tests and your MiniJava base folder is `~/code/mj` then run
``` ```
...@@ -232,8 +243,10 @@ MiniJava style recommendations ...@@ -232,8 +243,10 @@ MiniJava style recommendations
- All code should be valid Java code - All code should be valid Java code
- If code isn't valid Java code it should be located in a `.mj` file - If code isn't valid Java code it should be located in a `.mj` file
- All other code files should end with `.java` - All other code files should end with `.java`
- All functionality that could be useful for other test cases should be extracted into an importable files - All functionality that could be useful for other exec test cases should be extracted into a importable files
- Such importable files should be placed in a folder (or sub folder) of `lib` - Such importable files should be placed in a folder (or sub folder) of `exec/lib`
- the class `BooleanUtils` is an example for such an importable class
- it can be used in test cases via `import lib.BooleanUtils.java`
- Classes and methods should be documented with Javadocs if there name isn't self explanatory - Classes and methods should be documented with Javadocs if there name isn't self explanatory
### Class member ### Class member
......
Subproject commit 092d8f89f53b1c8ec13585bc49691290ddd74579 Subproject commit 7b63b1ad3aee376469e9af7700d4102e18bbd95b
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment