Skip to content

Commit f65be29

Browse files
authored
Merge pull request #455 from ethereum/noRemoteVersionsOption
Add test option to disable remote version tests.
2 parents fa2b8ab + 9651c85 commit f65be29

File tree

1 file changed

+23
-19
lines changed

1 file changed

+23
-19
lines changed

test/compiler.js

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ const solc = require('../index.js');
44
const linker = require('../linker.js');
55
const execSync = require('child_process').execSync;
66

7+
var noRemoteVersions = (process.argv.indexOf('--no-remote-versions') >= 0);
8+
79
function runTests (solc, versionText) {
810
console.log(`Running tests with ${versionText} ${solc.version()}`);
911

@@ -759,7 +761,7 @@ function runTests (solc, versionText) {
759761
});
760762

761763
// Only run on the latest version.
762-
if (versionText === 'latest') {
764+
if (versionText === 'latest' && !noRemoteVersions) {
763765
tape('Loading Legacy Versions', function (t) {
764766
t.test('loading remote version - development snapshot', function (st) {
765767
// getting the development snapshot
@@ -798,22 +800,24 @@ function runTests (solc, versionText) {
798800

799801
runTests(solc, 'latest');
800802

801-
// New compiler interface features 0.1.6, 0.2.1, 0.4.11, 0.5.0, etc.
802-
// 0.4.0 added pragmas (used in tests above)
803-
const versions = [
804-
'v0.1.1+commit.6ff4cd6',
805-
'v0.1.6+commit.d41f8b7',
806-
'v0.2.0+commit.4dc2445',
807-
'v0.2.1+commit.91a6b35',
808-
'v0.3.6+commit.3fc68da',
809-
'v0.4.0+commit.acd334c9',
810-
'v0.4.11+commit.68ef5810',
811-
'v0.4.12+commit.194ff033',
812-
'v0.4.26+commit.4563c3fc'
813-
];
814-
for (var version in versions) {
815-
version = versions[version];
816-
execSync(`curl -L -o /tmp/${version}.js https://solc-bin.ethereum.org/bin/soljson-${version}.js`);
817-
const newSolc = require('../wrapper.js')(require(`/tmp/${version}.js`));
818-
runTests(newSolc, version);
803+
if (!noRemoteVersions) {
804+
// New compiler interface features 0.1.6, 0.2.1, 0.4.11, 0.5.0, etc.
805+
// 0.4.0 added pragmas (used in tests above)
806+
const versions = [
807+
'v0.1.1+commit.6ff4cd6',
808+
'v0.1.6+commit.d41f8b7',
809+
'v0.2.0+commit.4dc2445',
810+
'v0.2.1+commit.91a6b35',
811+
'v0.3.6+commit.3fc68da',
812+
'v0.4.0+commit.acd334c9',
813+
'v0.4.11+commit.68ef5810',
814+
'v0.4.12+commit.194ff033',
815+
'v0.4.26+commit.4563c3fc'
816+
];
817+
for (var version in versions) {
818+
version = versions[version];
819+
execSync(`curl -L -o /tmp/${version}.js https://solc-bin.ethereum.org/bin/soljson-${version}.js`);
820+
const newSolc = require('../wrapper.js')(require(`/tmp/${version}.js`));
821+
runTests(newSolc, version);
822+
}
819823
}

0 commit comments

Comments
 (0)