git ssb

0+

cel-desktop / ssb-pkg



Tree: 67c0e15a98a66eb99db2251478505d6f3d37535c

Files: 67c0e15a98a66eb99db2251478505d6f3d37535c / test / test-50-console-trace / main.js

982 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 input = './test-x-index.js';
14const output = './test-output.exe';
15
16let right;
17
18utils.pkg.sync([
19 '--target', target,
20 '--output', output, input
21]);
22
23right = utils.spawn.sync(
24 './' + path.basename(output), [],
25 { cwd: path.dirname(output),
26 stdio: 'pipe', expect: 0 }
27);
28
29function extractFileName (line) {
30 let m = line.match(/^.+\((.+):\d+:\d+\)$/);
31 if (m) return m[1];
32 m = line.match(/^.+\((.+):\d+\)$/);
33 if (m) return m[1];
34 m = line.match(/^.+\((.+)\)$/);
35 if (m) return m[1];
36 return undefined;
37}
38
39right = right.stderr.split('\n');
40var a = right[0];
41var b = extractFileName(right[2]);
42var c = extractFileName(right[3]);
43assert.equal(a, b);
44assert.equal(c, 'pkg/prelude/bootstrap.js');
45utils.vacuum.sync(output);
46

Built with git-ssb-web