git ssb

0+

cel-desktop / ssb-pkg



Tree: efcf9fd06b02fa9bcd28681b4c777224e19702bb

Files: efcf9fd06b02fa9bcd28681b4c777224e19702bb / test / test-50-fs-runtime-layer / main.js

1016 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 target = process.argv[2] || 'host';
13const output = './run-time/test-output.exe';
14
15if (process.arch === 'arm') return;
16
17let left, right;
18utils.mkdirp.sync(path.dirname(output));
19
20left = utils.spawn.sync(
21 'node', [ 'test-x-index.js' ]
22);
23
24utils.pkg.sync([
25 '--target', target,
26 '--output', output, '.'
27]);
28
29right = utils.spawn.sync(
30 './' + path.basename(output), [],
31 { cwd: path.dirname(output) }
32);
33
34left = left.split('\n');
35right = right.split('\n');
36// right may have less lines, premature exit,
37// less trusted, so using left.length here
38for (let i = 0; i < left.length; i += 1) {
39 if (left[i] !== right[i]) {
40 console.log('line', i);
41 console.log('<<left<<\n' + left);
42 console.log('>>right>>\n' + right);
43 throw new Error('Assertion');
44 }
45}
46
47utils.vacuum.sync(path.dirname(output));
48

Built with git-ssb-web