From d67903a57b951adea9cae7cc0db723f6a57e91f1 Mon Sep 17 00:00:00 2001 From: Johannes Bechberger Date: Tue, 29 Nov 2016 12:03:01 +0100 Subject: [PATCH] Improve README --- README.mdwn | 43 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/README.mdwn b/README.mdwn index 8965973..9fbf1f5 100644 --- a/README.mdwn +++ b/README.mdwn @@ -22,11 +22,11 @@ The test cases are divided in 5 'modes': them. - __ast__: Test cases that check the generated ast by using the pretty printing functionality. - __semantic__: Test cases that check semantic checking of MiniJava programs -- __exec__: Test cases that check the correct compilation and execution of MiniJava programs. +- __compile-firm__: Test cases that check the correct compilation and execution of MiniJava programs with the libfirm backend. -_Only the lexer, syntax, ast and semantic mode are currently usable, but the others will follow._ +The test different test cases for each mode are located in a folder with the same name. +Except the compile-firm test cases which are located in the `exec` folder. -The test different test cases for each mode are located in a folder with the same name. The default directory that contains all test folders is `tests`. Sub folders in side the test case folders are allowed. @@ -43,7 +43,7 @@ Test types for the lexer mode File ending(s) of test casesExpected behaviour to complete a test of this type .valid.mj .mj - Return code is 0 and the output matches the expected output (located in the file `[test file].out` + Return code is 0 and the output matches the expected output (located in the file `[test file].out`) .invalid.mj @@ -89,7 +89,7 @@ Test types for the semantic mode - @@ -101,6 +101,29 @@ Test types for the semantic mode __All semantic mode tests have to be syntactically correct___ +Test types for the compile-firm mode +------------------------------------ + +
File ending(s) of test casesExpected behaviour to complete a test of this type
.valid.mj .mj .valid.java .java + .valid.mj .mj .valid.java .java Return code is 0, i.e. the MiniJava is accepted as semantically correct
+ + + + + + + + + +
File ending(s) of test casesExpected behaviour to complete a test of this type
.java .mjThe test file should compile. The resulting binary should be runnable and its output should be:
+ if a [test file].out exists: the content of this file
+ if no such file exists: the same as the execution of the file with java
.inf.java .inf.mjTests for infinite loops. The test file should compile. The binary should run at least 1 second. + The output should start with the content of the [test file].out file, if such file exists.
+ +__All compile-firm mode tests have to be semantically correct___ + +__All bigger test cases (e.g. for benchmarking) should be placed into the `big` folder__ + + Test runner ----------- @@ -125,11 +148,11 @@ To get colored output install the python3 module `termcolor`. Output of the `./mjt.py --help` ``` -usage: mjt.py [-h] [--only_incorrect_tests] [--produce_no_reports] - [--produce_all_reports] [--parallel] +usage: mjt.py [-h] [--only_incorrect_tests] [--all_exec_tests] + [--produce_no_reports] [--produce_all_reports] [--parallel] [--output_no_incorrect_reports] [--color] [--ci_testing] [--log_level LOG_LEVEL] - {all,lexer,syntax,ast,semantic,compile-firm.exec} MJ_RUN + {all,lexer,syntax,ast,semantic,compile-firm,exec} MJ_RUN MiniJava test runner @@ -144,6 +167,8 @@ optional arguments: -h, --help show this help message and exit --only_incorrect_tests Only run the tests that were incorrect the last run + --all_exec_tests Run all exec (compile-firm...) tests, not only the + small ones --produce_no_reports Produce no long reports besides the command line output --produce_all_reports @@ -195,6 +220,8 @@ MiniJava style recommendations ### General - All code should be valid Java code + - If code isn't valid Java code it should be located in a `.mj` file + - 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 - Such importable files should be placed in a folder (or sub folder) of `lib` - Classes and methods should be documented with Javadocs if there name isn't self explanatory -- GitLab