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

Commit

Permalink
test: test-50-bakery-4 for baking non-v8 options
Browse files Browse the repository at this point in the history
  • Loading branch information
igorklopov committed Dec 7, 2019
1 parent 061a977 commit 7ff6430
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
44 changes: 44 additions & 0 deletions test/test-50-bakery-4/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env node

'use strict';

const path = require('path');
const assert = require('assert');
const utils = require('../utils.js');

assert(!module.parent);
assert(__dirname === process.cwd());

const target = process.argv[2] || 'host';
const input = './test-x-index.js';
const output = './run-time/test-output.exe';

let left;
utils.mkdirp.sync(path.dirname(output));

left = utils.spawn.sync(
'node', [ '--v8-options' ],
{ cwd: path.dirname(input) }
);

for (const option of [ 'v8-options', 'v8_options' ]) {
let right;

utils.pkg.sync([
'--target', target,
'--options', option,
'--output', output, input
]);

right = utils.spawn.sync(
'./' + path.basename(output), [],
{ cwd: path.dirname(output) }
);

assert(left.indexOf('--expose_gc') >= 0 ||
left.indexOf('--expose-gc') >= 0);
assert(right.indexOf('--expose_gc') >= 0 ||
right.indexOf('--expose-gc') >= 0);
}

utils.vacuum.sync(path.dirname(output));
3 changes: 3 additions & 0 deletions test/test-50-bakery-4/test-x-index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use strict';

console.log('should not be executed');

0 comments on commit 7ff6430

Please sign in to comment.