#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/
https://codereview.adblockplus.org/29618577/
https://codereview.adblockplus.org/29622595/

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

Change History (11)

comment:1 Changed 22 months ago by hfiguiere

  • Status changed from new to reviewing

comment:2 Changed 22 months ago by abpbot

A commit referencing this issue has landed:
Issue 6090 - Allow use of console to be seen during tests

comment:3 Changed 22 months ago by hfiguiere

  • Review URL(s) modified (diff)

comment:4 Changed 22 months ago by hfiguiere

  • Summary changed from Silence expected C++ assertion outputs in tests to [emscripten] Silence expected C++ assertion outputs in tests

comment:5 Changed 22 months ago by abpbot

A commit referencing this issue has landed:
Issue 6090 - Silence warnings from the RSA signature tests

comment:6 Changed 22 months ago by hfiguiere

  • Resolution set to fixed
  • Status changed from reviewing to closed

comment:7 Changed 22 months ago by hfiguiere

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:8 Changed 22 months ago by hfiguiere

  • Review URL(s) modified (diff)

comment:9 Changed 22 months ago by hfiguiere

  • Status changed from reopened to reviewing

comment:11 Changed 22 months ago by hfiguiere

  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.