git ssb

0+

cel-desktop / ssb-pkg



Tree: 938b7ea4cfaa3cef6e1690b9ef3ea8bd7a0d2de1

Files: 938b7ea4cfaa3cef6e1690b9ef3ea8bd7a0d2de1 / test / test-50-bakery-4 / main.js

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

Built with git-ssb-web