Debian Codegraph @

framework/tests/whole-program-inference/README

raw
1 All tests for the whole-program-inference feature must be added to the
2 "non-annotated" folder. These tests must have expected error comments
3 (// :: error...) in places where the type-checker issues an error.
4 These are locations that an annotation is needed for it to
5 type-check. Also, these tests must ONLY have expected error comments for those
6 cases -- no other expected errors comments should be added.
7
8 The task wholeProgramInferenceTests tests the whole-program inference
9 in three steps:
10 1. The WholeProgramInferenceTest Checker will type-check all files in the
11 "non-annotated" folder, writing the inferred types of some elements into
12 .jaif files. The inferred types are written into .jaif files, but are not
13 considered during this type-check -- for that reason the expected error comments
14 are necessary.
15
16 2. All tests in "non-annotated" are copied to a temporary directory, named
17 "annotated". All expected error comments are removed from the files in
18 "annotated", and the insert-annotations-to-source tool will insert the
19 annotations that were inferred in the previous step into the files of the
20 temporary directory.
21
22 3. The WholeProgramInferenceValidationTest Checker will type-check all files in
23 the temporary "annotated" folder. The expected error comments were removed,
24 but the inferred types that were inserted should remove their occurrence during
25 the type-checking.
26
27 In order to test that an error will persist even after the whole-program inference,
28 this expected error must be added to the "non-annotated/ExpectedErrors.java"
29 file. This is the only file where the expected error comments are not removed
30 when copied to "annotated/ExpectedErrors.java".