shunit2 icon indicating copy to clipboard operation
shunit2 copied to clipboard

Rename assert skipping functions and add possibility to skip a test completely

Open JussiPekonen opened this issue 3 years ago • 0 comments

Changes:

  1. The *Skipping functions have been renamed to *SkippingAsserts to highlight that they are related to skipping asserts. The old functions are available for backwards compatibility but they print out a warning that they are deprecated.
  2. The generated report is tweaked to indicate the number of failed test cases (failed tests=X), failed asserts (failed asserts=Y), and skipped asserts (skipped asserts=Z). This will make the generated report convey the number of failures and skipped asserts more clearly than before.
  3. New functionality: function skipTest is introduced that allows all asserts and fails in a test to be skipped. This function must be called in the very beginning of the test case, and if it is called after startSkippingAsserts or any assert/fail function, it will fail the test case. Furthermore, it will print out a warning that the test is skipped, and all asserts and fails in the test case will be skipped without incrementing the assert counters. It will, however, increment a counter for skipped tests, which will be shown in the generated report (skipped tests=X).

The documentation and examples have been updated accordingly.

JussiPekonen avatar Jul 07 '22 07:07 JussiPekonen