git ssb

0+

cel-desktop / ssb-pkg



Tree: 4c58f1c6c3ddb86a97f27f0c84681d201ef1f75f

Files: 4c58f1c6c3ddb86a97f27f0c84681d201ef1f75f / test / test-46-multi-arch-2 / main.js

1021 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
12if (function () {
13 // testing armv7-to-armv6 crosscompilation
14 if (process.platform === 'linux' && process.arch === 'arm') return false;
15 // TODO what about armv8? we need to distingish host arch
16 // armv6/armv7/armv8 - not just 'arm' we have now
17 // linux may not have multiarch installed
18 if (process.platform === 'linux') return true;
19 return false;
20}()) return;
21
22const opposite = { x64: 'x86',
23 x86: 'x64', ia32: 'x64', arm: 'armv6' };
24
25const target = opposite[process.arch];
26const input = './test-x-index.js';
27const output = './test-output.exe';
28
29let right;
30
31utils.pkg.sync([
32 '--target', target,
33 '--output', output, input
34], { stdio: 'inherit' });
35
36right = utils.spawn.sync(
37 './' + path.basename(output), [],
38 { cwd: path.dirname(output) }
39);
40
41assert.equal(right, '42\n');
42utils.vacuum.sync(output);
43

Built with git-ssb-web