Skip to content

Commit ef1a6dc

Browse files
committed
update test readme.md
1 parent 1392a94 commit ef1a6dc

File tree

1 file changed

+12
-10
lines changed
  • graalpython/com.oracle.graal.python.test/testData

1 file changed

+12
-10
lines changed

graalpython/com.oracle.graal.python.test/testData/readme.txt renamed to graalpython/com.oracle.graal.python.test/testData/readme.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Parser tests howto
2+
13
The folders here contains golden files and test file that are used for testing
24
parser.
35

@@ -10,6 +12,8 @@ Folder `goldenFiles` contains golden files for tests, where the parsed source
1012
for the test is a string. The structure is that the folder is class name, where
1113
the test is and the name of file is to the of the test. So for example:
1214

15+
16+
```java
1317
public class AssignmentTests extends ParserTestBase {
1418

1519
@Test
@@ -18,6 +22,7 @@ public class AssignmentTests extends ParserTestBase {
1822
}
1923

2024
}
25+
```
2126

2227
creates file assignment01.tast (if not exists yet) in folder `AssignmentTests`
2328
in `goldenFiles` folder.
@@ -28,6 +33,7 @@ that is tested.
2833

2934
For example:
3035

36+
```java
3137
public class RuntimeFileTests extends ParserTestBase {
3238

3339
@Test
@@ -36,6 +42,7 @@ public class RuntimeFileTests extends ParserTestBase {
3642
}
3743

3844
}
45+
```
3946

4047
This test is looking for file `testFiles/RuntimeFileTests/_collections_abc.py`
4148
and after first run are created `testFiles/RuntimeFileTests/_collections_abc.scope`
@@ -46,22 +53,17 @@ source. The golden file is generated with the old parser and compares the result
4653
from new parser. If the old parser generate wrong tree, then it should be
4754
manually corrected or reused the output from new parser.
4855

49-
5056
If there is a change in a tree, that causes failing many tests, then it can be
5157
done by deleting all `.tast` files, then run parser tests and check, whether
5258
the diffs are correct.
5359

5460
These commands should do it:
5561

56-
--------------------------------------------------
57-
58-
$ cd graalpython/com.oracle.graal.python.test/testData
59-
60-
$ find . -name "*.tast" -delete
61-
62-
$ mx punittest com.oracle.graal.python.test.parser
63-
64-
--------------------------------------------------
62+
```shell
63+
cd graalpython/com.oracle.graal.python.test/testData
64+
find . -name "*.tast" -delete
65+
mx punittest com.oracle.graal.python.test.parser
66+
```
6567

6668
After this all `.tast` files are regenerated. Currently after the regeneration
6769
there are two test failing `DictAndSetTests.dict09` and `DictAndSetTests.dict10`.

0 commit comments

Comments
 (0)