Ticket #195 (closed enhancement: fixed)
Alter Unit Test Assert behavior to continue until exit
Reported by: | torial | Owned by: | Chuck |
---|---|---|---|
Priority: | medium | Milestone: | Cobra 0.9 |
Component: | Cobra Compiler | Version: | 0.8.0 |
Keywords: | test assert | Cc: |
Description
Currently when the application is run, all unit tests will run until an assert fails. This (on Windows) gets funneled up and Windows Error Reporting gives an option to report to MS or to debug the application or cancel.
Suggested changes:
* For tests only, make it so asserts don't throw a terminating exception, but do trigger the application to exit.
* Allow all tests to be run before triggering the application to exit. This doesn't include other asserts in the same test, rather any other "test" blocks for other functions or classes.
Possible implementation ideas:
Auto wrap the test case in a try/catch block, if the assert exception occurs, set an app exit flag, and log the assert info for the report. This should make it possible to run all tests. Then check the flag to see if the application should terminate.