mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 18:02:24 +00:00
compiler: readd skipWithoutSolc
Signed-off-by: RJ Catalano <rj@monax.io>
This commit is contained in:
parent
163e8d868e
commit
10bce71bed
1 changed files with 17 additions and 0 deletions
|
|
@ -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 {
|
func writeToTempFile(tmpfile *os.File, content []byte) error {
|
||||||
|
|
||||||
if _, err := tmpfile.Write(content); err != nil {
|
if _, err := tmpfile.Write(content); err != nil {
|
||||||
|
|
@ -134,6 +140,8 @@ func writeToTempFile(tmpfile *os.File, content []byte) error {
|
||||||
|
|
||||||
func TestSolcCompilerNormal(t *testing.T) {
|
func TestSolcCompilerNormal(t *testing.T) {
|
||||||
|
|
||||||
|
skipWithoutSolc(t)
|
||||||
|
|
||||||
solc, err := InitSolc("solc")
|
solc, err := InitSolc("solc")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Could not initialize solc: %v", err)
|
t.Fatalf("Could not initialize solc: %v", err)
|
||||||
|
|
@ -166,6 +174,9 @@ func TestSolcCompilerNormal(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestSolcCompilerError(t *testing.T) {
|
func TestSolcCompilerError(t *testing.T) {
|
||||||
|
|
||||||
|
skipWithoutSolc(t)
|
||||||
|
|
||||||
solc, err := InitSolc("solc")
|
solc, err := InitSolc("solc")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Could not initialize solc: %v", err)
|
t.Fatalf("Could not initialize solc: %v", err)
|
||||||
|
|
@ -197,6 +208,8 @@ func TestSolcCompilerError(t *testing.T) {
|
||||||
|
|
||||||
func TestSolcCompilerWarning(t *testing.T) {
|
func TestSolcCompilerWarning(t *testing.T) {
|
||||||
|
|
||||||
|
skipWithoutSolc(t)
|
||||||
|
|
||||||
solc, err := InitSolc("solc")
|
solc, err := InitSolc("solc")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Could not initialize solc: %v", err)
|
t.Fatalf("Could not initialize solc: %v", err)
|
||||||
|
|
@ -228,6 +241,8 @@ func TestSolcCompilerWarning(t *testing.T) {
|
||||||
|
|
||||||
func TestLinkingBinaries(t *testing.T) {
|
func TestLinkingBinaries(t *testing.T) {
|
||||||
|
|
||||||
|
skipWithoutSolc(t)
|
||||||
|
|
||||||
solc, err := InitSolc("solc")
|
solc, err := InitSolc("solc")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Could not initialize solc: %v", err)
|
t.Fatalf("Could not initialize solc: %v", err)
|
||||||
|
|
@ -268,6 +283,8 @@ func TestLinkingBinaries(t *testing.T) {
|
||||||
|
|
||||||
func TestRemappings(t *testing.T) {
|
func TestRemappings(t *testing.T) {
|
||||||
|
|
||||||
|
skipWithoutSolc(t)
|
||||||
|
|
||||||
solc, err := InitSolc("solc")
|
solc, err := InitSolc("solc")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Could not initialize solc: %v", err)
|
t.Fatalf("Could not initialize solc: %v", err)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue