Opened on 11/24/2017 at 10:12:17 AM
Closed on 11/29/2017 at 08:02:16 PM
#6090 closed change (fixed)
[emscripten] Silence expected C++ assertion outputs in tests
Reported by: | sergz | Assignee: | hfiguiere |
---|---|---|---|
Priority: | Unknown | Milestone: | |
Module: | Core | Keywords: | |
Cc: | hfiguiere, trev | Blocked By: | |
Blocking: | Platform: | Unknown / Cross platform | |
Ready: | no | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
https://codereview.adblockplus.org/29616611/ |
Description
Background
In C++-emscripten we are using assert, however they are not stopping the application execution nor throwing exceptions, they are merely logging errors. That allows us to earlier identify runtime errors having at the same time only one logic in both the application and the tests.
However, in order to have a clean output of tests and finally to not miss a real issue it would be good to hide expected error entries in the output.
What to change
- bind console.* methods to actually printing ones instead of stubs as it's currently
- add helper method silenceAssertionOutput(fn, expectedErrorMessage) which calls fn intercepting the calls of error outputs occurred during the call and does nothing when the output text matches /^Error: ${expectedErrorMessage}[\r\n]/. If we could distinguish between errors arising from assert and others it would be even better.
- adapt corresponding tests
Attachments (0)
Change History (11)
comment:1 Changed on 11/24/2017 at 03:49:14 PM by hfiguiere
- Status changed from new to reviewing
comment:2 Changed on 11/24/2017 at 08:58:36 PM by abpbot
comment:4 Changed on 11/25/2017 at 03:18:06 PM by hfiguiere
- Summary changed from Silence expected C++ assertion outputs in tests to [emscripten] Silence expected C++ assertion outputs in tests
comment:5 Changed on 11/27/2017 at 02:14:44 PM by abpbot
A commit referencing this issue has landed:
Issue 6090 - Silence warnings from the RSA signature tests
comment:6 Changed on 11/27/2017 at 02:15:35 PM by hfiguiere
- Resolution set to fixed
- Status changed from reviewing to closed
comment:7 Changed on 11/28/2017 at 02:09:08 PM by hfiguiere
- Resolution fixed deleted
- Status changed from closed to reopened
comment:9 Changed on 11/28/2017 at 03:29:54 PM by hfiguiere
- Status changed from reopened to reviewing
comment:10 Changed on 11/29/2017 at 08:01:49 PM by abpbot
A commit referencing this issue has landed:
Issue 6090 - Properly use regexp for message matching and proper console override
comment:11 Changed on 11/29/2017 at 08:02:16 PM by hfiguiere
- Resolution set to fixed
- Status changed from reviewing to closed
A commit referencing this issue has landed:
Issue 6090 - Allow use of console to be seen during tests