Files: 1eb144e388da5f1a3466703f56ac4ab591d700fc / test / test-50-bakery-3 / main.js
922 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 | let left, right; |
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 | utils.pkg.sync([ |
25 | '--target', target, |
26 | '--output', output, input |
27 | ]); |
28 | |
29 | right = utils.spawn.sync( |
30 | './' + path.basename(output), |
31 | [ '--v8-options' ], |
32 | { cwd: path.dirname(output), |
33 | env: { PKG_EXECPATH: 'PKG_INVOKE_NODEJS' } } |
34 | ); |
35 | |
36 | assert(left.indexOf('--expose_gc') >= 0 || |
37 | left.indexOf('--expose-gc') >= 0); |
38 | assert(right.indexOf('--expose_gc') >= 0 || |
39 | right.indexOf('--expose-gc') >= 0); |
40 | utils.vacuum.sync(path.dirname(output)); |
41 |
Built with git-ssb-web