Feature skip
Adds a few things:
- Counters for passed and skipped assertions.
- A
skipkeyword that will cause the nextassertto ignore any failures and increase theskippedcounter instead. - The colour yellow for skipped tests.
- Suppression of colour output if stdin is not a terminal.
Currently based on the POSIX update.
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.
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 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.
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 what is the status of this PR?
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.