mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -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>
37 lines
721 B
JavaScript
37 lines
721 B
JavaScript
'use strict';
|
|
|
|
require('../common');
|
|
|
|
const {
|
|
generateSEA,
|
|
skipIfSingleExecutableIsNotSupported,
|
|
} = require('../common/sea');
|
|
|
|
skipIfSingleExecutableIsNotSupported();
|
|
|
|
// This tests "useCodeCache" is ignored when "useSnapshot" is true.
|
|
|
|
const tmpdir = require('../common/tmpdir');
|
|
const {
|
|
spawnSyncAndAssert,
|
|
} = require('../common/child_process');
|
|
const fixtures = require('../common/fixtures');
|
|
|
|
{
|
|
tmpdir.refresh();
|
|
|
|
const outputFile = generateSEA(fixtures.path('sea', 'snapshot-and-code-cache'));
|
|
|
|
spawnSyncAndAssert(
|
|
outputFile,
|
|
{
|
|
env: {
|
|
NODE_DEBUG_NATIVE: 'SEA,MKSNAPSHOT',
|
|
...process.env,
|
|
},
|
|
}, {
|
|
stdout: 'Hello from snapshot',
|
|
trim: true,
|
|
});
|
|
}
|