Skip to content

Commit

Permalink
test: show stderr on v8 coverage test failures
Browse files Browse the repository at this point in the history
PR-URL: #26513
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Coe <bencoe@gmail.com>
  • Loading branch information
joyeecheung authored and targos committed Mar 30, 2019
1 parent ab70c96 commit 03bd649
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/parallel/test-v8-coverage.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ function nextdir() {
const output = spawnSync(process.execPath, [
require.resolve('../fixtures/v8-coverage/basic')
], { env: { ...process.env, NODE_V8_COVERAGE: coverageDirectory } });
if (output.status !== 0) {
console.log(output.stderr.toString());
}
assert.strictEqual(output.status, 0);
assert.strictEqual(output.stderr.toString(), '');
const fixtureCoverage = getFixtureCoverage('basic.js', coverageDirectory);
Expand All @@ -38,6 +41,9 @@ function nextdir() {
const output = spawnSync(process.execPath, [
require.resolve('../fixtures/v8-coverage/exit-1')
], { env: { ...process.env, NODE_V8_COVERAGE: coverageDirectory } });
if (output.status !== 1) {
console.log(output.stderr.toString());
}
assert.strictEqual(output.status, 1);
assert.strictEqual(output.stderr.toString(), '');
const fixtureCoverage = getFixtureCoverage('exit-1.js', coverageDirectory);
Expand All @@ -55,6 +61,9 @@ function nextdir() {
require.resolve('../fixtures/v8-coverage/sigint')
], { env: { ...process.env, NODE_V8_COVERAGE: coverageDirectory } });
if (!common.isWindows) {
if (output.signal !== 'SIGINT') {
console.log(output.stderr.toString());
}
assert.strictEqual(output.signal, 'SIGINT');
}
assert.strictEqual(output.stderr.toString(), '');
Expand All @@ -72,6 +81,9 @@ function nextdir() {
const output = spawnSync(process.execPath, [
require.resolve('../fixtures/v8-coverage/spawn-subprocess')
], { env: { ...process.env, NODE_V8_COVERAGE: coverageDirectory } });
if (output.status !== 0) {
console.log(output.stderr.toString());
}
assert.strictEqual(output.status, 0);
assert.strictEqual(output.stderr.toString(), '');
const fixtureCoverage = getFixtureCoverage('subprocess.js',
Expand All @@ -89,6 +101,9 @@ function nextdir() {
const output = spawnSync(process.execPath, [
require.resolve('../fixtures/v8-coverage/worker')
], { env: { ...process.env, NODE_V8_COVERAGE: coverageDirectory } });
if (output.status !== 0) {
console.log(output.stderr.toString());
}
assert.strictEqual(output.status, 0);
assert.strictEqual(output.stderr.toString(), '');
const fixtureCoverage = getFixtureCoverage('subprocess.js',
Expand All @@ -106,6 +121,9 @@ function nextdir() {
const output = spawnSync(process.execPath, [
require.resolve('../fixtures/v8-coverage/spawn-subprocess-no-cov')
], { env: { ...process.env, NODE_V8_COVERAGE: coverageDirectory } });
if (output.status !== 0) {
console.log(output.stderr.toString());
}
assert.strictEqual(output.status, 0);
assert.strictEqual(output.stderr.toString(), '');
const fixtureCoverage = getFixtureCoverage('subprocess.js',
Expand All @@ -119,6 +137,9 @@ function nextdir() {
const output = spawnSync(process.execPath, [
require.resolve('../fixtures/v8-coverage/async-hooks')
], { env: { ...process.env, NODE_V8_COVERAGE: coverageDirectory } });
if (output.status !== 0) {
console.log(output.stderr.toString());
}
assert.strictEqual(output.status, 0);
assert.strictEqual(output.stderr.toString(), '');
const fixtureCoverage = getFixtureCoverage('async-hooks.js',
Expand All @@ -138,6 +159,9 @@ function nextdir() {
cwd: tmpdir.path,
env: { ...process.env, NODE_V8_COVERAGE: coverageDirectory }
});
if (output.status !== 0) {
console.log(output.stderr.toString());
}
assert.strictEqual(output.status, 0);
assert.strictEqual(output.stderr.toString(), '');
const fixtureCoverage = getFixtureCoverage('basic.js',
Expand Down

0 comments on commit 03bd649

Please sign in to comment.