@@ -3,6 +3,9 @@ const semver = require('semver');
3
3
const solc = require ( '../index.js' ) ;
4
4
const linker = require ( '../linker.js' ) ;
5
5
6
+ function runTests ( solc , versionText ) {
7
+ console . log ( `Running tests with ${ versionText } ${ solc . version ( ) } ` ) ;
8
+
6
9
function getBytecode ( output , fileName , contractName ) {
7
10
try {
8
11
var outputContract ;
@@ -31,6 +34,9 @@ function getBytecodeStandard (output, fileName, contractName) {
31
34
}
32
35
}
33
36
37
+ tape ( versionText , function ( t ) {
38
+ var tape = t . test ;
39
+
34
40
tape ( 'Version and license' , function ( t ) {
35
41
t . test ( 'check version' , function ( st ) {
36
42
st . equal ( typeof solc . version ( ) , 'string' ) ;
@@ -527,6 +533,11 @@ tape('Compilation', function (t) {
527
533
} ) ;
528
534
} ) ;
529
535
536
+ } ) ;
537
+
538
+ // Only run on the latest version.
539
+ if ( versionText === 'latest' ) {
540
+
530
541
tape ( 'Loading Legacy Versions' , function ( t ) {
531
542
t . test ( 'loading remote version - development snapshot' , function ( st ) {
532
543
// getting the development snapshot
@@ -568,3 +579,27 @@ tape('API backwards compatibility', function (t) {
568
579
st . end ( ) ;
569
580
} ) ;
570
581
} ) ;
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