Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce pedantic mode for tester #2797

Merged
merged 1 commit into from May 25, 2015
Merged

Conversation

avsej
Copy link
Contributor

@avsej avsej commented May 25, 2015

Motivation

External tools need to know whether or not any test in suite failed. For
example buildbot, or packaging tool would like to stop the execution and
mark it as failed if some tests does not pass.

Modification

Add --pedantic switch to tester program which will force it to quit
with non-zero exit code if at least one failure detected. Also update
tests() proc in koch to inspect result from tester and propagate it to
user.

Result

Nothing has changed in default behaviour. But following invocations will
exit with non-zero code if there failed tests:

./koch tests --pedantic all
./tests/testament/tester --pedantic all

Fixes #2793

@flaviut
Copy link
Contributor

flaviut commented May 25, 2015

LGTM

backend.close()
if optPedantic:
var failed = r.total - r.passed - r.skipped
if failed > 0 : quit(failed)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it could be simplified (although less readable)

if optPedantic:
  quit(r.total - r.passed - r.skipped)

I can do it if you like

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for the "simplified" version, but use 'let' instead of 'var'.

Motivation
----------
External tools need to know whether or not any test in suite failed. For
example buildbot, or packaging tool would like to stop the execution and
mark it as failed if some tests does not pass.

Modification
------------
Add `--pedantic` switch to tester program which will force it to quit
with non-zero exit code if at least one failure detected. Also update
`tests()` proc in koch to inspect result from tester and propagate it to
user.

Result
------
Nothing has changed in default behaviour. But following invocations will
exit with non-zero code if there failed tests:

    ./koch tests --pedantic all
    ./tests/testament/tester --pedantic all
Araq added a commit that referenced this pull request May 25, 2015
Introduce pedantic mode for tester
@Araq Araq merged commit 475520f into nim-lang:devel May 25, 2015
@avsej avsej deleted the pedantic-tester branch May 25, 2015 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

koch tests returns success even when there are failed scenarios
3 participants