Skip to content

Commit f272af9

Browse files
committed
Run tests for bunch of more versions
1 parent bba5ab9 commit f272af9

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

test/compiler.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ const semver = require('semver');
33
const solc = require('../index.js');
44
const linker = require('../linker.js');
55

6+
function runTests (solc, versionText) {
7+
console.log(`Running tests with ${versionText} ${solc.version()}`);
8+
69
function getBytecode (output, fileName, contractName) {
710
try {
811
var outputContract;
@@ -31,6 +34,9 @@ function getBytecodeStandard (output, fileName, contractName) {
3134
}
3235
}
3336

37+
tape(versionText, function (t) {
38+
var tape = t.test;
39+
3440
tape('Version and license', function (t) {
3541
t.test('check version', function (st) {
3642
st.equal(typeof solc.version(), 'string');
@@ -527,6 +533,11 @@ tape('Compilation', function (t) {
527533
});
528534
});
529535

536+
});
537+
538+
// Only run on the latest version.
539+
if (versionText === 'latest') {
540+
530541
tape('Loading Legacy Versions', function (t) {
531542
t.test('loading remote version - development snapshot', function (st) {
532543
// getting the development snapshot
@@ -568,3 +579,27 @@ tape('API backwards compatibility', function (t) {
568579
st.end();
569580
});
570581
});
582+
583+
}
584+
585+
}
586+
587+
runTests(solc, 'latest');
588+
589+
// New features 0.1.6, 0.2.1, 0.4.11, 0.5.0, etc.
590+
const versions = [
591+
'v0.1.1+commit.6ff4cd6',
592+
'v0.1.6+commit.d41f8b7',
593+
'v0.2.0+commit.4dc2445',
594+
'v0.2.1+commit.91a6b35',
595+
'v0.3.6+commit.3fc68da',
596+
'v0.4.26+commit.4563c3fc'
597+
];
598+
for (var version in versions) {
599+
version = versions[version];
600+
solc.loadRemoteVersion(version, function (err, solc) {
601+
if (!err) {
602+
runTests(solc, version);
603+
}
604+
});
605+
}

0 commit comments

Comments
 (0)