You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file provides the `diff_test_updater` function, which is invoked on failed RUN lines when lit is executed with --update-tests.
5
7
It checks whether the failed command is `diff` and, if so, uses heuristics to determine which file is the checked-in reference file and which file is output from the test case.
6
8
The heuristics are currently as follows:
9
+
- if exactly one file originates from the `split-file` command, that file is the reference file and the other is the output file
7
10
- if exactly one file ends with ".expected" (common pattern in LLVM), that file is the reference file and the other is the output file
8
11
- if exactly one file path contains ".tmp" (e.g. because it contains the expansion of "%t"), that file is the reference file and the other is the output file
9
12
If the command matches one of these patterns the output file content is copied to the reference file to make the test pass.
13
+
If the reference file originated in `split-file`, the output file content is instead copied to the corresponding slice of the test file.
10
14
Otherwise the test is ignored.
11
15
12
16
Possible improvements:
13
17
- Support stdin patterns like "my_binary %s | diff expected.txt"
14
-
- Scan RUN lines to see if a file is the source of output from a previous command.
18
+
- Scan RUN lines to see if a file is the source of output from a previous command (other than `split-file`).
15
19
If it is then it is not a reference file that can be copied to, regardless of name, since the test will overwrite it anyways.
16
20
- Only update the parts that need updating (based on the diff output). Could help avoid noisy updates when e.g. whitespace changes are ignored.
0 commit comments