Files: d456a6cc8589489e558e6164750474ed2cfc961e / test / test-50-reproducible / main.js
883 bytesRaw
1 | |
2 | |
3 | 'use strict'; |
4 | |
5 | const fs = require('fs'); |
6 | const assert = require('assert'); |
7 | const utils = require('../utils.js'); |
8 | |
9 | assert(!module.parent); |
10 | assert(__dirname === process.cwd()); |
11 | |
12 | const target = process.argv[2] || 'host'; |
13 | const input = './test-x-index.js'; |
14 | const output1 = './test-output-1.exe'; |
15 | const 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 | |
21 | utils.pkg.sync([ |
22 | '--public', |
23 | '--no-bytecode', |
24 | '--target', target, |
25 | '--output', output1, input |
26 | ]); |
27 | |
28 | utils.pkg.sync([ |
29 | '--public', |
30 | '--no-bytecode', |
31 | '--target', target, |
32 | '--output', output2, input |
33 | ]); |
34 | |
35 | const content1 = fs.readFileSync(output1); |
36 | const content2 = fs.readFileSync(output2); |
37 | assert.equal(Buffer.compare(content1, content2), 0); |
38 | utils.vacuum.sync(output1); |
39 | utils.vacuum.sync(output2); |
40 |
Built with git-ssb-web