M2 icon indicating copy to clipboard operation
M2 copied to clipboard

M2errorRegexp in html.m2 is incorrect

Open jkyang92 opened this issue 6 years ago • 3 comments
trafficstars

Line 455 is currently

M2errorRegexp := "^[^:\n]+:[0-9]+:[0-9]+:(\\([0-9]+\\)):\\[[0-9]+\\]: "

It should probably say

M2errorRegexp := "^[^:\n]+:[0-9]+:[0-9]+:(\\([0-9]+\\)): "

This fixes an issue where check(Package) doesn't report the actual errors in tests.

jkyang92 avatar Sep 28 '19 03:09 jkyang92

Could you give an example of an error message detected by this but not by the other?

DanGrayson avatar Sep 28 '19 07:09 DanGrayson

I just realized what's causing this issue in check, for some reason error messages from stdio look like this:

stdio:14:1:(3): error: assertion failed

But error messages from files look like this:

ErrorPackage.m2:8:20:(2):[1]: error: assertion failed

And the way tests are run, we get the first format of error message when running tests.

As such, my suggested regexp is also wrong. "^[^:\n]+:[0-9]+:[0-9]+:(\\([0-9]+\\)):(\\[[0-9]+\\]:)? " would probably be more correct, but it might also be a bug in how error messages get printed with stdio.

To test the specific behavior I mentioned, I've attached an example package with two different failing tests. without changing the regexp, I don't get the following line of the output of the first test:

stdio:3:1:(3): error: assertion failed

ErrorPackage.m2.txt

jkyang92 avatar Sep 28 '19 13:09 jkyang92

Was this fixed at some point? I tried check("ErrorPackage"), but it worked correctly (i.e., the check failed).

mahrud avatar Jul 29 '20 01:07 mahrud