mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
parent
01b97124c8
commit
0e57fc4c5f
@ -18,10 +18,12 @@ package processtest_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
exec "golang.org/x/sys/execabs"
|
||||
)
|
||||
@ -43,7 +45,10 @@ func TestPrograms(t *testing.T) {
|
||||
}
|
||||
|
||||
t.Run(n, func(t *testing.T) {
|
||||
cmd := exec.Command("go", "run", filepath.Join(dir, n))
|
||||
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
|
||||
defer cancel()
|
||||
|
||||
cmd := exec.CommandContext(ctx, "go", "run", filepath.Join(dir, n))
|
||||
stderr := &bytes.Buffer{}
|
||||
cmd.Stderr = stderr
|
||||
if err := cmd.Run(); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user