Commit da8ccf5a authored by isaacs's avatar isaacs

don't print failure message if there's a bailout

parent e0f159e8
......@@ -419,23 +419,25 @@ Parser.prototype.emitComplete = function (skipAll) {
if (!this.results) {
var res = this.results = new FinalResults(!!skipAll, this)
// comment a bit at the end so we know what happened.
// but don't repeat these comments if they're already present.
if (res.plan.end !== res.count && !res.bailout)
this.emitComment('test count(' + res.count +
') != plan(' + res.plan.end + ')', false, true)
if (res.fail > 0 && !res.ok)
this.emitComment('failed ' + res.fail +
(res.count > 1 ? ' of ' + res.count + ' tests'
: ' test'),
false, true)
if (res.todo > 0)
this.emitComment('todo: ' + res.todo, false, true)
if (res.skip > 0)
this.emitComment('skip: ' + res.skip, false, true)
if (!res.bailout) {
// comment a bit at the end so we know what happened.
// but don't repeat these comments if they're already present.
if (res.plan.end !== res.count)
this.emitComment('test count(' + res.count +
') != plan(' + res.plan.end + ')', false, true)
if (res.fail > 0 && !res.ok)
this.emitComment('failed ' + res.fail +
(res.count > 1 ? ' of ' + res.count + ' tests'
: ' test'),
false, true)
if (res.todo > 0)
this.emitComment('todo: ' + res.todo, false, true)
if (res.skip > 0)
this.emitComment('skip: ' + res.skip, false, true)
}
this.emit('complete', this.results)
}
......
......@@ -39,10 +39,6 @@ var expect = [
"bailout",
"# saw that coming"
],
[
"comment",
"# failed 1 of 2 tests\n"
],
[
"complete",
{
......
......@@ -29,14 +29,6 @@
"bailout",
""
],
[
"line",
"# failed 1 test\n"
],
[
"comment",
"# failed 1 test\n"
],
[
"complete",
{
......
......@@ -29,14 +29,6 @@
"bailout",
""
],
[
"line",
"# failed 1 test\n"
],
[
"comment",
"# failed 1 test\n"
],
[
"complete",
{
......
......@@ -29,14 +29,6 @@
"bailout",
""
],
[
"line",
"# failed 1 test\n"
],
[
"comment",
"# failed 1 test\n"
],
[
"complete",
{
......
......@@ -29,14 +29,6 @@
"bailout",
""
],
[
"line",
"# failed 1 test\n"
],
[
"comment",
"# failed 1 test\n"
],
[
"complete",
{
......
......@@ -52,14 +52,6 @@
"bailout",
"# no they aren't"
],
[
"line",
"# failed 1 test\n"
],
[
"comment",
"# failed 1 test\n"
],
[
"complete",
{
......@@ -100,10 +92,6 @@
"line",
" Bail out! # no they aren't\n"
],
[
"line",
" # failed 1 test\n"
],
[
"bailout",
"# no they aren't"
......
......@@ -52,14 +52,6 @@
"bailout",
"# no they aren't"
],
[
"line",
"# failed 1 test\n"
],
[
"comment",
"# failed 1 test\n"
],
[
"complete",
{
......@@ -100,10 +92,6 @@
"line",
" Bail out! # no they aren't\n"
],
[
"line",
" # failed 1 test\n"
],
[
"bailout",
"# no they aren't"
......
......@@ -60,14 +60,6 @@
"bailout",
"# no they aren't"
],
[
"line",
"# failed 1 test\n"
],
[
"comment",
"# failed 1 test\n"
],
[
"complete",
{
......@@ -108,10 +100,6 @@
"line",
" Bail out! # no they aren't\n"
],
[
"line",
" # failed 1 test\n"
],
[
"bailout",
"# no they aren't"
......
......@@ -60,14 +60,6 @@
"bailout",
"# no they aren't"
],
[
"line",
"# failed 1 test\n"
],
[
"comment",
"# failed 1 test\n"
],
[
"complete",
{
......@@ -108,10 +100,6 @@
"line",
" Bail out! # no they aren't\n"
],
[
"line",
" # failed 1 test\n"
],
[
"bailout",
"# no they aren't"
......
......@@ -68,14 +68,6 @@
"bailout",
"# no they aren't"
],
[
"line",
"# failed 1 test\n"
],
[
"comment",
"# failed 1 test\n"
],
[
"complete",
{
......@@ -116,10 +108,6 @@
"line",
" Bail out! # no they aren't\n"
],
[
"line",
" # failed 1 test\n"
],
[
"bailout",
"# no they aren't"
......
......@@ -68,14 +68,6 @@
"bailout",
"# no they aren't"
],
[
"line",
"# failed 1 test\n"
],
[
"comment",
"# failed 1 test\n"
],
[
"complete",
{
......@@ -116,10 +108,6 @@
"line",
" Bail out! # no they aren't\n"
],
[
"line",
" # failed 1 test\n"
],
[
"bailout",
"# no they aren't"
......
......@@ -76,14 +76,6 @@
"bailout",
"# no they aren't"
],
[
"line",
"# failed 1 test\n"
],
[
"comment",
"# failed 1 test\n"
],
[
"complete",
{
......@@ -124,10 +116,6 @@
"line",
" Bail out! # no they aren't\n"
],
[
"line",
" # failed 1 test\n"
],
[
"bailout",
"# no they aren't"
......
......@@ -76,14 +76,6 @@
"bailout",
"# no they aren't"
],
[
"line",
"# failed 1 test\n"
],
[
"comment",
"# failed 1 test\n"
],
[
"complete",
{
......@@ -124,10 +116,6 @@
"line",
" Bail out! # no they aren't\n"
],
[
"line",
" # failed 1 test\n"
],
[
"bailout",
"# no they aren't"
......
......@@ -51,14 +51,6 @@
"bailout",
""
],
[
"line",
"# failed 1 test\n"
],
[
"comment",
"# failed 1 test\n"
],
[
"complete",
{
......@@ -98,10 +90,6 @@
"line",
" Bail out!\n"
],
[
"line",
" # failed 1 test\n"
],
[
"bailout",
""
......
......@@ -51,14 +51,6 @@
"bailout",
""
],
[
"line",
"# failed 1 test\n"
],
[
"comment",
"# failed 1 test\n"
],
[
"complete",
{
......@@ -98,10 +90,6 @@
"line",
" Bail out!\n"
],
[
"line",
" # failed 1 test\n"
],
[
"bailout",
""
......
......@@ -59,14 +59,6 @@
"bailout",
""
],
[
"line",
"# failed 1 test\n"
],
[
"comment",
"# failed 1 test\n"
],
[
"complete",
{
......@@ -106,10 +98,6 @@
"line",
" Bail out!\n"
],
[
"line",
" # failed 1 test\n"
],
[
"bailout",
""
......
......@@ -59,14 +59,6 @@
"bailout",
""
],
[
"line",
"# failed 1 test\n"
],
[
"comment",
"# failed 1 test\n"
],
[
"complete",
{
......@@ -106,10 +98,6 @@
"line",
" Bail out!\n"
],
[
"line",
" # failed 1 test\n"
],
[
"bailout",
""
......
......@@ -95,14 +95,6 @@
"bailout",
"# please sir, my son, he is sick"
],
[
"line",
"# failed 1 test\n"
],
[
"comment",
"# failed 1 test\n"
],
[
"complete",
{
......
......@@ -95,14 +95,6 @@
"bailout",
"# please sir, my son, he is sick"
],
[
"line",
"# failed 1 test\n"
],
[
"comment",
"# failed 1 test\n"
],
[
"complete",
{
......
......@@ -103,14 +103,6 @@
"bailout",
"# please sir, my son, he is sick"
],
[
"line",
"# failed 1 test\n"
],
[
"comment",
"# failed 1 test\n"
],
[
"complete",
{
......
......@@ -103,14 +103,6 @@
"bailout",
"# please sir, my son, he is sick"
],
[
"line",
"# failed 1 test\n"
],
[
"comment",
"# failed 1 test\n"
],
[
"complete",
{
......
......@@ -114,14 +114,6 @@
"bailout",
"# please sir, my son, he is sick"
],
[
"line",
"# failed 1 test\n"
],
[
"comment",
"# failed 1 test\n"
],
[
"complete",
{
......
......@@ -114,14 +114,6 @@
"bailout",
"# please sir, my son, he is sick"
],
[
"line",
"# failed 1 test\n"
],
[
"comment",
"# failed 1 test\n"
],
[
"complete",
{
......
......@@ -122,14 +122,6 @@
"bailout",
"# please sir, my son, he is sick"
],
[
"line",
"# failed 1 test\n"
],
[
"comment",
"# failed 1 test\n"
],
[
"complete",
{
......
......@@ -122,14 +122,6 @@
"bailout",
"# please sir, my son, he is sick"
],
[
"line",
"# failed 1 test\n"
],
[
"comment",
"# failed 1 test\n"
],
[
"complete",
{
......
......@@ -102,14 +102,6 @@
"bailout",
"# child"
],
[
"line",
"# failed 1 test\n"
],
[
"comment",
"# failed 1 test\n"
],
[
"complete",
{
......
......@@ -102,14 +102,6 @@
"bailout",
"# child"
],
[
"line",
"# failed 1 test\n"
],
[
"comment",
"# failed 1 test\n"
],
[
"complete",
{
......
......@@ -102,14 +102,6 @@
"bailout",
"# child"
],
[
"line",
"# failed 1 test\n"
],
[
"comment",
"# failed 1 test\n"
],
[
"complete",
{
......
......@@ -102,14 +102,6 @@
"bailout",
"# child"
],
[
"line",
"# failed 1 test\n"
],
[
"comment",
"# failed 1 test\n"
],
[
"complete",
{
......
......@@ -19,14 +19,6 @@
"bailout",
"# 1"
],
[
"line",
"# failed 1 test\n"
],
[
"comment",
"# failed 1 test\n"
],
[
"complete",
{
......
......@@ -19,14 +19,6 @@
"bailout",
"# 1"
],
[
"line",
"# failed 1 test\n"