tests: Print the failing line numbers when a test fails.
Currently, if a probe fails, it will print the line number of the [test] block the probe is in, not the line number of the probe itself. This makes it somewhat difficult to debug.
This commit makes it print the line number that a test fails at.
This code was actually written by @hverbeet for my first attempt at fixing this, !499 (closed).
CC @zfigura
Merge request reports
Activity
One thing I have noticed is that if there's shader code that doesn't compile at all, there's not really a helpful message. It says
Test failed: Got unexpected hr 0x80004005.
on a line after the code block.I don't think it's the world's biggest priority because compile errors aren't really what we're testing for here, though.
Yeah, one fallout of this change is that actions that happen at the end of a section (i.e. most prominently code compilation, but also setting resources) get the line number of the starting of the following section, which can be confusing. It shouldn't be too hard to fix that, though: I just need to delay
vkd3d_test_push_context()
a little bit an push another context for theif (!ret || line[0] == '[')
block inshader_runner.c
.I'd say the point is rather that, independently of whether you're testing compilation or preprocessing, while the parser is scanning the code section the code itself is only copied line by line in buffer
shader_source
. Only then the following line beginning with[
is found the parser knows that the section is finished and can preprocess/compile it. By that moment the line number is that of the beginning of the following section, which might result in a misleading error message, unless you set a different context while the parser is within the scope ofif (!ret || line[0] == '[')
.
mentioned in merge request !499 (closed)
added 1 commit
- 623b112e - tests: Print the failing line numbers when a test fails.
added 69 commits
-
623b112e...f96a7918 - 68 commits from branch
wine:master
- 09b6bc5f - tests: Print the failing line numbers when a test fails.
-
623b112e...f96a7918 - 68 commits from branch
added 8 commits
-
09b6bc5f...812f01c2 - 7 commits from branch
wine:master
- 62f18f74 - tests: Print the failing line numbers when a test fails.
-
09b6bc5f...812f01c2 - 7 commits from branch