Files: 67c0e15a98a66eb99db2251478505d6f3d37535c / test / test-50-bakery-2 / main.js
802 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', [ '--expose-gc', path.basename(input) ], |
21 | { cwd: path.dirname(input) } |
22 | ); |
23 | |
24 | utils.pkg.sync([ |
25 | '--target', target, |
26 | '--options', 'expose-gc', |
27 | '--output', output, input |
28 | ]); |
29 | |
30 | right = utils.spawn.sync( |
31 | './' + path.basename(output), [], |
32 | { cwd: path.dirname(output) } |
33 | ); |
34 | |
35 | assert.equal(left, 'function\n'); |
36 | assert.equal(right, 'function\n'); |
37 | utils.vacuum.sync(path.dirname(output)); |
38 |
Built with git-ssb-web