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
I am using VS Code, and it supports parsing output messages to detect filenames, which you can then Ctrl-Click to open in the code editor. However, this apparently only works with absolute paths(/full/path/to/test/criterion_tests.c), not with relative paths.
The Unity test framework, for example, outputs the absolute path for failed tests. Here, Ctrl-clicking on the failed tests does bring up the corresponding file in the code editor and navigates to the associated line number of the failed test:
Running unity tests ...
/home/foobar/test-project/build/test/Debug/unity_testsuite
/home/foobar/test-project/test/unity_tests.c:16:x_should_equal_1:FAIL: Expected 0 Was 1
Any idea how to configure Criterion to use absolute rather than relative paths?
Note: I found a workaround in https://criterion.readthedocs.io/en/master/env.html by setting -S or --short-filename, which turns ./test/criterion_tests.c:15 into criterion_tests.c:15. Surprisingly, this does allow VS Code to make the output Ctrl-clickable. This is an acceptable workaround for me, but it would be nice to still have the option to see the full, absolute path so that folder hierarchies can be used to visually/logically group tests.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Criterion uses relative paths in its test output:
I am using VS Code, and it supports parsing output messages to detect filenames, which you can then Ctrl-Click to open in the code editor. However, this apparently only works with absolute paths(
/full/path/to/test/criterion_tests.c
), not with relative paths.The Unity test framework, for example, outputs the absolute path for failed tests. Here, Ctrl-clicking on the failed tests does bring up the corresponding file in the code editor and navigates to the associated line number of the failed test:
Any idea how to configure Criterion to use absolute rather than relative paths?
Note: I found a workaround in https://criterion.readthedocs.io/en/master/env.html by setting
-S or --short-filename
, which turns./test/criterion_tests.c:15
intocriterion_tests.c:15
. Surprisingly, this does allow VS Code to make the output Ctrl-clickable. This is an acceptable workaround for me, but it would be nice to still have the option to see the full, absolute path so that folder hierarchies can be used to visually/logically group tests.Beta Was this translation helpful? Give feedback.
All reactions