-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
testsuite/tests/formatting: remove native-compiler location tests #9871
Conversation
The tests for -dlocations are painful to update for native compiler backends. They were previously restricted to 64bit architectures only ( e577855 ), and disabled on AFL ( 829b00b ), but the fact that they have to be updated for both clambda and flambda backends is annoying in practice. This commit disables location-testing completely for the native backend, and only checks locations in the bytecode compiler intermediate representations, from -dparsetree to -dlambda. Note: now the we have bytecode-only versions of the test, it should be more portable. The test has been re-enabled for 32bit and AFL configurations. It will still need tweaking in the future if people perform configuration-dependent changes on the Lambda representation (but hopefully those changes could be disabled by command-line options to be added to the test configuration). (no change entry needed)
7156620
to
d213ff5
Compare
I was the one who introduced those tests when I introduced the I looked at past changes to the tests, and determined that (just like clambda/flambda issues) they are all related to the native-compiler tests. This PR removes those native-compiler tests but keep the bytecode tests. One may ask whether the tests shouldn't be removed entirely, or changed in some way so that they almost never fail (one idea for example would be to grep for the sourcefile name, and check that it does occur in the output with
For these reasons I propose a reactive approach to test output shrinking. I started with tests for each part of my change (each intermediate-output touched by |
I agree we have too many fragile tests in the test suite, where the reference output needs to be updated all the time. Another example is tests that record a full exception backtrace in the reference output. These tests break every time line numbers change in the source of the tests, e.g. because the magic ocamltest comment at the top is changed. This is annoying indeed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restricting this test to bytecode only should make it easier to maintain, indeed.
Thanks! For exception backtraces and ocamltest headers: this may be solvable with a good old lexer line-number directive. I tried them for the present test and they don't work here, because locations as currently printed contain absolute positions that are not reset by line directives. |
Xavier Leroy (2020/09/02 02:38 -0700):
I agree we have too many fragile tests in the test suite, where the reference output needs to be updated all the time.
Another example is tests that record a full exception backtrace in the
reference output. These tests break every time line numbers change in
the source of the tests, e.g. because the magic ocamltest comment at
the top is changed. This is annoying indeed.
The test could be written in an other module than the main one so the
length of the test block wouldn't matter any longer.
|
Or maybe change the |
Damien Doligez (2021/01/13 02:54 -0800):
Or maybe change the `ocamltest` parser to allow placing the test block
at the end of the file?
Hmm, not sure I find this very intuitive, but if there is a ocnsensus
that it may help, I can work on it.
|
The tests for -dlocations are painful to update for native compiler
backends. They were previously restricted to 64bit architectures only
( e577855 ), and disabled on AFL
( 829b00b ), but the fact that they
have to be updated for both clambda and flambda backends is annoying
in practice. This commit disables location-testing completely for the
native backend, and only checks locations in the bytecode compiler
intermediate representations, from -dparsetree to -dlambda.
Note: now the we have bytecode-only versions of the test, it should be
more portable. The test has been re-enabled for 32bit and AFL
configurations. It will still need tweaking in the future if people
perform configuration-dependent changes on the Lambda representation
(but hopefully those changes could be disabled by command-line options
to be added to the test configuration).
(no change entry needed)