Files: 67c0e15a98a66eb99db2251478505d6f3d37535c / test / test-50-bakery-4 / main.js
1131 bytesRaw
1 | |
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 | if (/^(node|v)?0/.test(target)) return; |
17 | if (/^(node|v)?4/.test(target)) return; |
18 | if (/^(node|v)?6/.test(target)) return; |
19 | if (/^(node|v)?8/.test(target)) return; |
20 | |
21 | let left; |
22 | utils.mkdirp.sync(path.dirname(output)); |
23 | |
24 | left = utils.spawn.sync( |
25 | 'node', [ '--v8-options' ], |
26 | { cwd: path.dirname(input) } |
27 | ); |
28 | |
29 | for (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 | |
49 | utils.vacuum.sync(path.dirname(output)); |
50 |
Built with git-ssb-web