SNSystems / dexter

DExTer - Debug Experience Tester
MIT License
33 stars 6 forks source link

Add command parse error message tests and fix failures #65

Closed OCHyams closed 4 years ago

OCHyams commented 5 years ago

The new tests featuretests/subtools/test/err* each have a comment describing their purpose in test.cpp. The directories have a check.txt which holds the FileCheck directives for each test so that dexter doesn't parse embedded commands.

TypeError exception error messages use many carets to point to the error. like this() ^^^^^^

The tests for TypeError exceptions look for a single caret at the end of the command name because that behaviour will allow multi-line command errors to be represented in the same way as single-line command errors.

A unit test test_parse_empty has been added which ensures empty source files are silently ignored.

This patch fixes the error reporting so that these new tests all pass. The CommandParseError construction has been unified with the introduction of the function format_parse_err. There has been some small tidy-up effort too.

All of this combined will should make fixing the still XFAIL parsing unit tests much easier and safer.

OCHyams commented 4 years ago

Thanks, removed the unnecessary else block