Files: 1eb144e388da5f1a3466703f56ac4ab591d700fc / test / test-50-native-addon-3 / main.js
1197 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 pairs = [ |
15 | { input: './lib/test-x-index.js', output: './lib/test-output.exe' }, |
16 | { input: './lib/test-x-index.js', output: './lib/community/test-output.exe' }, |
17 | { input: './lib/test-x-index.js', output: './lib/enterprise/test-output.exe' }, |
18 | { input: './lib/community/test-y-index.js', output: './lib/community/test-output.exe' }, |
19 | { input: './lib/enterprise/test-z-index.js', output: './lib/enterprise/test-output.exe' } |
20 | ]; |
21 | |
22 | pairs.some(function (pair) { |
23 | const input = pair.input; |
24 | const output = pair.output; |
25 | |
26 | let left, right; |
27 | |
28 | left = utils.spawn.sync( |
29 | 'node', [ path.basename(input) ], |
30 | { cwd: path.dirname(input) } |
31 | ); |
32 | |
33 | utils.pkg.sync([ |
34 | '--target', target, |
35 | '--output', output, input |
36 | ]); |
37 | |
38 | right = utils.spawn.sync( |
39 | './' + path.basename(output), [], |
40 | { cwd: path.dirname(output) } |
41 | ); |
42 | |
43 | assert.equal(left, right); |
44 | utils.vacuum.sync(output); |
45 | }); |
46 |
Built with git-ssb-web