eclipse-cdt-cloud / cdt-gdb-adapter

CDT GDB Debug Adapter
Eclipse Public License 2.0
27 stars 40 forks source link

Add basic testing for the MIParser #312

Closed jonahgraham closed 8 months ago

jonahgraham commented 8 months ago

Until now the MIParser was just being tested by its use within integration tests. This change adds testability for the MIParser as a unit.

Some small restructuring of the MIParser to make it testable.

Part of #311

jonahgraham commented 8 months ago

@XingMicrochip if what I just pushed passes all the tests I will merge it and you can use the new miparser.spec.ts as a basis for writing new tests for the parser without having to jump through hoops of trying to get gdb to provide the problematic output.

It would be good, for #308, to have a new test that verifies that the end-to-end works once #311 is fully resolved.

jonahgraham commented 8 months ago

There seems to be a small behaviour difference on Windows vs Linux in one of my new tests. I am looking at it now.

jonahgraham commented 8 months ago

Perhaps I don't know how to setup a mock readable object properly. The tests work fine on both my Windows and Linux machine, but not on the build machine. As those tests are needed to develop the fix I have reverted just those tests (you can see what I elided looking at this diff)