Skip to content

Commit a69e4c6

Browse files
committed
add additional module test and go 1.12 for travis
1 parent 1c379d8 commit a69e4c6

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ go:
77
- 1.9.x
88
- 1.10.x
99
- 1.11.x
10+
- 1.12.x
1011

1112
go_import_path: github.com/DATA-DOG/godog
1213

builder_go111_test.go

+44
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,50 @@ import (
1010
"testing"
1111
)
1212

13+
func TestGodogBuildWithModuleOutsideGopathAndHavingOnlyFeature(t *testing.T) {
14+
dir := filepath.Join(os.TempDir(), "godogs")
15+
err := buildTestPackage(dir, map[string]string{
16+
"godogs.feature": builderFeatureFile,
17+
})
18+
if err != nil {
19+
os.RemoveAll(dir)
20+
t.Fatal(err)
21+
}
22+
defer os.RemoveAll(dir)
23+
24+
prevDir, err := os.Getwd()
25+
if err != nil {
26+
t.Fatal(err)
27+
}
28+
29+
if err := os.Chdir(dir); err != nil {
30+
t.Fatal(err)
31+
}
32+
defer os.Chdir(prevDir)
33+
34+
if out, err := exec.Command("go", "mod", "init", "godogs").CombinedOutput(); err != nil {
35+
t.Log(string(out))
36+
t.Fatal(err)
37+
}
38+
39+
if out, err := exec.Command("go", "mod", "edit", "-require", "github.com/DATA-DOG/[email protected]").CombinedOutput(); err != nil {
40+
t.Log(string(out))
41+
t.Fatal(err)
42+
}
43+
44+
var stdout, stderr bytes.Buffer
45+
cmd := buildTestCommand(t, "godogs.feature")
46+
cmd.Stdout = &stdout
47+
cmd.Stderr = &stderr
48+
cmd.Env = os.Environ()
49+
50+
if err := cmd.Run(); err != nil {
51+
t.Log(stdout.String())
52+
t.Log(stderr.String())
53+
t.Fatal(err)
54+
}
55+
}
56+
1357
func TestGodogBuildWithModuleOutsideGopath(t *testing.T) {
1458
dir := filepath.Join(os.TempDir(), "godogs")
1559
err := buildTestPackage(dir, map[string]string{

0 commit comments

Comments
 (0)