1'use strict';
2const common = require('../../common');
3const assert = require('assert');
4const child_process = require('child_process');
5
6if (process.argv[2] === 'child') {
7  require(`./build/${common.buildType}/binding`);
8} else {
9  const { stdout, status, signal } =
10    child_process.spawnSync(process.execPath, [__filename, 'child']);
11  assert.strictEqual(status, 0, `process exited with status(${status}) and signal(${signal})`);
12  assert.strictEqual(stdout.toString().trim(), 'cleanup(42)');
13}
14