From c2372eac1678a6f0af433dd80be9fbd17c49170a Mon Sep 17 00:00:00 2001 From: Eugene Ostroukhov Date: Wed, 18 Jul 2018 23:12:19 -0700 Subject: [PATCH] test: add tracing crash regression test PR-URL: https://github.com/nodejs/node/pull/21867 Reviewed-By: James M Snell Reviewed-By: Anna Henningsen Reviewed-By: Ali Ijaz Sheikh --- test/parallel/test-tracing-no-crash.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test/parallel/test-tracing-no-crash.js diff --git a/test/parallel/test-tracing-no-crash.js b/test/parallel/test-tracing-no-crash.js new file mode 100644 index 00000000000000..816bd95df02e29 --- /dev/null +++ b/test/parallel/test-tracing-no-crash.js @@ -0,0 +1,14 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const { spawn } = require('child_process'); + +function CheckNoSignalAndErrorCodeOne(code, signal) { + assert.strictEqual(null, signal); + assert.strictEqual(1, code); +} + +const child = spawn(process.execPath, + ['--trace-event-categories', 'madeup', '-e', + 'throw new Error()'], { stdio: 'inherit' }); +child.on('exit', common.mustCall(CheckNoSignalAndErrorCodeOne));