git ssb

0+

cel-desktop / ssb-pkg



Tree: 4c58f1c6c3ddb86a97f27f0c84681d201ef1f75f

Files: 4c58f1c6c3ddb86a97f27f0c84681d201ef1f75f / test / test-50-reproducible / main.js

883 bytesRaw
1#!/usr/bin/env node
2
3'use strict';
4
5const fs = require('fs');
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 output1 = './test-output-1.exe';
15const output2 = './test-output-2.exe';
16
17// v8 introduced random bits in snapshots
18// version 6.0 (nodejs 8.3.0)
19// TODO make v8 nullify pointers upon serializing
20
21utils.pkg.sync([
22 '--public',
23 '--no-bytecode',
24 '--target', target,
25 '--output', output1, input
26]);
27
28utils.pkg.sync([
29 '--public',
30 '--no-bytecode',
31 '--target', target,
32 '--output', output2, input
33]);
34
35const content1 = fs.readFileSync(output1);
36const content2 = fs.readFileSync(output2);
37assert.equal(Buffer.compare(content1, content2), 0);
38utils.vacuum.sync(output1);
39utils.vacuum.sync(output2);
40

Built with git-ssb-web