Skip to content
This repository was archived by the owner on Jan 13, 2024. It is now read-only.

Commit 7ff6430

Browse files
committedDec 7, 2019
test: test-50-bakery-4 for baking non-v8 options
1 parent 061a977 commit 7ff6430

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed
 

‎test/test-50-bakery-4/main.js

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/usr/bin/env node
2+
3+
'use strict';
4+
5+
const path = require('path');
6+
const assert = require('assert');
7+
const utils = require('../utils.js');
8+
9+
assert(!module.parent);
10+
assert(__dirname === process.cwd());
11+
12+
const target = process.argv[2] || 'host';
13+
const input = './test-x-index.js';
14+
const output = './run-time/test-output.exe';
15+
16+
let left;
17+
utils.mkdirp.sync(path.dirname(output));
18+
19+
left = utils.spawn.sync(
20+
'node', [ '--v8-options' ],
21+
{ cwd: path.dirname(input) }
22+
);
23+
24+
for (const option of [ 'v8-options', 'v8_options' ]) {
25+
let right;
26+
27+
utils.pkg.sync([
28+
'--target', target,
29+
'--options', option,
30+
'--output', output, input
31+
]);
32+
33+
right = utils.spawn.sync(
34+
'./' + path.basename(output), [],
35+
{ cwd: path.dirname(output) }
36+
);
37+
38+
assert(left.indexOf('--expose_gc') >= 0 ||
39+
left.indexOf('--expose-gc') >= 0);
40+
assert(right.indexOf('--expose_gc') >= 0 ||
41+
right.indexOf('--expose-gc') >= 0);
42+
}
43+
44+
utils.vacuum.sync(path.dirname(output));

‎test/test-50-bakery-4/test-x-index.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
'use strict';
2+
3+
console.log('should not be executed');

0 commit comments

Comments
 (0)
This repository has been archived.