compiler: readd skipWithoutSolc

Signed-off-by: RJ Catalano <rj@monax.io>
This commit is contained in:
RJ Catalano 2017-08-20 18:58:10 -05:00
parent 163e8d868e
commit 10bce71bed
No known key found for this signature in database
GPG key ID: D4AB109D9B5D6386

View file

@ -121,6 +121,12 @@ library Set {
}
}`
func skipWithoutSolc(t *testing.T) {
if _, err := exec.LookPath("solc"); err != nil {
t.Skip(err)
}
}
func writeToTempFile(tmpfile *os.File, content []byte) error {
if _, err := tmpfile.Write(content); err != nil {
@ -134,6 +140,8 @@ func writeToTempFile(tmpfile *os.File, content []byte) error {
func TestSolcCompilerNormal(t *testing.T) {
skipWithoutSolc(t)
solc, err := InitSolc("solc")
if err != nil {
t.Fatalf("Could not initialize solc: %v", err)
@ -166,6 +174,9 @@ func TestSolcCompilerNormal(t *testing.T) {
}
func TestSolcCompilerError(t *testing.T) {
skipWithoutSolc(t)
solc, err := InitSolc("solc")
if err != nil {
t.Fatalf("Could not initialize solc: %v", err)
@ -197,6 +208,8 @@ func TestSolcCompilerError(t *testing.T) {
func TestSolcCompilerWarning(t *testing.T) {
skipWithoutSolc(t)
solc, err := InitSolc("solc")
if err != nil {
t.Fatalf("Could not initialize solc: %v", err)
@ -228,6 +241,8 @@ func TestSolcCompilerWarning(t *testing.T) {
func TestLinkingBinaries(t *testing.T) {
skipWithoutSolc(t)
solc, err := InitSolc("solc")
if err != nil {
t.Fatalf("Could not initialize solc: %v", err)
@ -268,6 +283,8 @@ func TestLinkingBinaries(t *testing.T) {
func TestRemappings(t *testing.T) {
skipWithoutSolc(t)
solc, err := InitSolc("solc")
if err != nil {
t.Fatalf("Could not initialize solc: %v", err)