The crash when compiling stdin was fixed in solc 0.3.6 (released
2016-08-10). While here, simplify the test so it runs with any solc
version.
Fixes#3484. The byte code was different for each run because recent
solc embeds the swarm hash of contract metadata into the code. When
compiling from stdin the name in the metadata is constant.
testInfo=`{"source":"\ncontract test {\n /// @notice Will multiply `+"`a`"+` by 7.\n function multiply(uint a) returns(uint d) {\n return a * 7;\n }\n}\n","language":"Solidity","languageVersion":"0.1.1","compilerVersion":"0.1.1","compilerOptions":"--binary file --json-abi file --natspec-user file --natspec-dev file --add-std 1","abiDefinition":[{"constant":false,"inputs":[{"name":"a","type":"uint256"}],"name":"multiply","outputs":[{"name":"d","type":"uint256"}],"type":"function"}],"userDoc":{"methods":{"multiply(uint256)":{"notice":"Will multiply `+"`a`"+` by 7."}}},"developerDoc":{"methods":{}}}`
)
funcskipUnsupported(t*testing.T){
sol,err:=SolidityVersion("")
iferr!=nil{
funcskipWithoutSolc(t*testing.T){
if_,err:=exec.LookPath("solc");err!=nil{
t.Skip(err)
return
}
ifsol.Version!=supportedSolcVersion{
t.Skipf("unsupported version of solc found (%v, expect %v)",sol.Version,supportedSolcVersion)