File tree Expand file tree Collapse file tree 3 files changed +31
-12
lines changed Expand file tree Collapse file tree 3 files changed +31
-12
lines changed Original file line number Diff line number Diff line change @@ -8,9 +8,6 @@ branches:
8
8
matrix :
9
9
fast_finish : true
10
10
include :
11
- - os : linux
12
- node_js : ' 4'
13
- env : CXX=g++-4.8 TEST_SUITE=test
14
11
- os : linux
15
12
node_js : ' 6'
16
13
env : CXX=g++-4.8 TEST_SUITE=test
Original file line number Diff line number Diff line change @@ -51,15 +51,8 @@ function abort (msg) {
51
51
}
52
52
53
53
if ( argv [ 'standard-json' ] ) {
54
- var size = fs . fstatSync ( process . stdin . fd ) . size ;
55
-
56
- if ( size <= 0 ) {
57
- abort ( 'Empty input was read' ) ;
58
- }
59
-
60
- var input = fs . readSync ( process . stdin . fd , size ) [ 0 ] ;
61
-
62
- console . log ( solc . compileStandardWrapper ( input ) ) ;
54
+ var input = fs . readFileSync ( process . stdin . fd ) ;
55
+ console . log ( solc . compile ( input . toString ( 'utf8' ) ) )
63
56
process . exit ( 0 ) ;
64
57
} else if ( files . length === 0 ) {
65
58
console . error ( 'Must provide a file' ) ;
Original file line number Diff line number Diff line change @@ -62,4 +62,33 @@ tape('CLI', function (t) {
62
62
spt . succeeds ( ) ;
63
63
spt . end ( ) ;
64
64
} ) ;
65
+
66
+ t . test ( 'standard json' , function ( st ) {
67
+ var input = {
68
+ 'language' : 'Solidity' ,
69
+ 'settings' : {
70
+ 'outputSelection' : {
71
+ '*' : {
72
+ '*' : [ 'evm.bytecode' , 'userdoc' ]
73
+ }
74
+ }
75
+ } ,
76
+ 'sources' : {
77
+ 'Contract.sol' : {
78
+ 'content' : 'pragma solidity ^0.5.0; contract Contract { function f() pure public {} }'
79
+ }
80
+ }
81
+ } ;
82
+ var spt = spawn ( st , './solcjs --standard-json' ) ;
83
+ spt . stdin . setEncoding ( 'utf-8' ) ;
84
+ spt . stdin . write ( JSON . stringify ( input ) ) ;
85
+ spt . stdin . end ( ) ;
86
+ spt . stdin . on ( 'finish' , function ( ) {
87
+ spt . stderr . empty ( ) ;
88
+ spt . stdout . match ( / C o n t r a c t .s o l / ) ;
89
+ spt . stdout . match ( / u s e r d o c / ) ;
90
+ spt . succeeds ( ) ;
91
+ spt . end ( ) ;
92
+ } ) ;
93
+ } ) ;
65
94
} ) ;
You can’t perform that action at this time.
0 commit comments