shpec icon indicating copy to clipboard operation
shpec copied to clipboard

Feature skip

Open hlangeveld opened this issue 10 years ago • 6 comments

Adds a few things:

  1. Counters for passed and skipped assertions.
  2. A skip keyword that will cause the next assert to ignore any failures and increase the skipped counter instead.
  3. The colour yellow for skipped tests.
  4. Suppression of colour output if stdin is not a terminal.

Currently based on the POSIX update.

hlangeveld avatar Apr 19 '15 09:04 hlangeveld

I'm looking into adding support for an option -f <expected_failure_count> to make this produce its full output and to make it pass the full test in the case of expected failures.
Check my 'travis' branch from this feature for live updates.

hlangeveld avatar Apr 19 '15 11:04 hlangeveld

I would like to see some review before we even consider to pull this. (For one thing, I forgot to bump the version. Again.)

In the shpec files, this just adds one keyword: skip_next_assert.

Skipping some assertions requires support for managing shell errors, extra colours in output, and extra counters beyond the number of failed tests/assertions. We now add counters for passed and skipped assertions.

In passing, this eliminated another external command by using a case statement instead of grep. We also cater for tests without a terminal by prefixing output with the two character codes 'NO', 'OK', and '??'.

An extra challenge was added by imposing the -e and -u options onto shpec. It makes for more robust scripts, but potential errors are easily overlooked.

hlangeveld avatar Apr 19 '15 23:04 hlangeveld

@hlangeveld let's focus on getting #58 merged before pushing this any further. My main concern is that without discussing and collaborating on these features, we can easily get away from shpec's base intentions.

rylnd avatar Apr 21 '15 19:04 rylnd

On 04/21/15 21:40, Ryland Herrick wrote:

@hlangeveld https://github.com/hlangeveld let's focus on getting #58 https://github.com/rylnd/shpec/pull/58 merged before pushing this any further. My main concern is that without discussing and collaborating on these features, we can easily get away from shpec's base intentions.

That's fine. I did some not very clean refactoring in this bit, and it got interspersed with adding the feature. I'd rather complete the POSIX PR first, then refactor, and then we can discuss the 'skip' feature.

Cheers all, Henk

hlangeveld avatar Apr 21 '15 20:04 hlangeveld

@hlangeveld what is the status of this PR?

rylnd avatar Apr 02 '17 21:04 rylnd

Good question. Let me have a look... . . . In its current state I believe I need to refactor the whole thing again before resubmitting. Not tonight though.

hlangeveld avatar Apr 03 '17 23:04 hlangeveld