Problem with working in the web editor for Cobol

Due to the way cobolcheck works, to create test.cob, the error messages in the web editor are disconnected from the visible code:

My program doesn’t have a line 137. There is no indication about what “test.cob” is.

I don’t have a concrete solution for this, but I have an idea brewing. In the next few days, I’ll have a look at the test runner.

1 Like

Which exercise is this from?

It happens to be Bob, but the test runner reports error line numbers from that .cob file for every exercise.

The test runner should map that line to the corresponding line in the solution file. That should be pretty straightforward.

I expect it has proved to be harder than first thought. We might be better off having a chat with the test runner maker.

How the testing scheme works is that it takes your COBOL sources and a given test file and concatenates them into a one single COBOL source code file, adding some additional code to interpret the test cases. It is usually larger than your sources.

It is a hassle to debug, you would need to be able to peek into the resulting COBOL file, like in this case. It’s easier to try out at home, using the client to download the exercise.

The other option is to change our testing tool. IIRC we chose the one we’re using from a list of three or four options. I should probably try to find that list and re-examine.

I have just discovered something about GnuCOBOL: it has its own testing mechanism. This looks promising for simplifying the existing tests and getting better error notifications.