Files: ca90b5ca0579ebdcc0635288bce4978e3fb200f5 / test / test-50-native-addon-4 / main.js
774 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 host = 'node' + process.version.match(/^v(\d+)/)[1]; |
13 | const target = process.argv[2] || host; |
14 | const input = './test-x-index.js'; |
15 | const output = './run-time/test-output.exe'; |
16 | |
17 | let left, right; |
18 | utils.mkdirp.sync(path.dirname(output)); |
19 | |
20 | left = utils.spawn.sync( |
21 | 'node', [ path.basename(input) ], |
22 | { cwd: path.dirname(input) } |
23 | ); |
24 | |
25 | utils.pkg.sync([ |
26 | '--target', target, |
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, right); |
36 | utils.vacuum.sync(path.dirname(output)); |
37 |
Built with git-ssb-web