mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
Instead of copying and writing files on the fly for SEA tests, put the fixtures into a directory and copy them into tmpdir for testing. This allows easier reproduction and debugging when they do fail - we can just copy the entire fixture directory and test directly from there. PR-URL: https://github.com/nodejs/node/pull/61167 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
46 lines
957 B
JavaScript
46 lines
957 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
|
|
const {
|
|
generateSEA,
|
|
skipIfSingleExecutableIsNotSupported,
|
|
} = require('../common/sea');
|
|
|
|
skipIfSingleExecutableIsNotSupported();
|
|
|
|
// This tests the creation of a single executable application with an empty
|
|
// script.
|
|
|
|
const tmpdir = require('../common/tmpdir');
|
|
const fixtures = require('../common/fixtures');
|
|
const { spawnSyncAndExitWithoutError } = require('../common/child_process');
|
|
|
|
tmpdir.refresh();
|
|
|
|
let outputFile;
|
|
try {
|
|
outputFile = generateSEA(fixtures.path('sea', 'empty'), {
|
|
verifyWorkflow: true,
|
|
});
|
|
} catch (e) {
|
|
if (/Cannot copy/.test(e.message)) {
|
|
common.skip(e.message);
|
|
} else if (common.isWindows) {
|
|
if (/Cannot sign/.test(e.message) || /Cannot find signtool/.test(e.message)) {
|
|
common.skip(e.message);
|
|
}
|
|
}
|
|
|
|
throw e;
|
|
}
|
|
|
|
spawnSyncAndExitWithoutError(
|
|
outputFile,
|
|
{
|
|
env: {
|
|
NODE_DEBUG_NATIVE: 'SEA',
|
|
...process.env,
|
|
},
|
|
});
|