forked from ethereum-optimism/optimism
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_helper.go
26 lines (23 loc) · 736 Bytes
/
build_helper.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package op_e2e
import (
"context"
"os/exec"
"strings"
"testing"
"time"
"github.com/stretchr/testify/require"
)
// BuildOpProgramClient builds the `op-program` client executable and returns the path to the resulting executable
func BuildOpProgramClient(t *testing.T) string {
t.Log("Building op-program-client")
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
defer cancel()
cmd := exec.CommandContext(ctx, "make", "op-program-client")
cmd.Dir = "../op-program"
var out strings.Builder
cmd.Stdout = &out
cmd.Stderr = &out
require.NoErrorf(t, cmd.Run(), "Failed to build op-program-client: %v", &out)
t.Log("Built op-program-client successfully")
return "../op-program/bin/op-program-client"
}