git ssb

0+

cel-desktop / ssb-pkg



Tree: 1eb144e388da5f1a3466703f56ac4ab591d700fc

Files: 1eb144e388da5f1a3466703f56ac4ab591d700fc / test / test-50-native-addon-3 / main.js

1197 bytesRaw
1#!/usr/bin/env node
2
3'use strict';
4
5const path = require('path');
6const assert = require('assert');
7const utils = require('../utils.js');
8
9assert(!module.parent);
10assert(__dirname === process.cwd());
11
12const host = 'node' + process.version.match(/^v(\d+)/)[1];
13const target = process.argv[2] || host;
14const 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
22pairs.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