Skip to content

Commit ce88866

Browse files
godebug is now building on Travis CI and AppVeyor
1 parent 276912d commit ce88866

File tree

5 files changed

+21
-10
lines changed

5 files changed

+21
-10
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ language: go
33
go:
44
- 1.4
55

6-
install: true # Skip install step
6+
install: go install
77

8-
script: go test -v
8+
script: go test -v --parallel-tests=10
99

1010
os:
1111
- linux

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
godebug [![build](https://img.shields.io/badge/build-passing-green.svg)](https://godebug-cross-platform-ci.appspot.com/)
1+
godebug
2+
23
-------
4+
[![Linux Build Status](https://img.shields.io/travis/mailgun/godebug.svg?label=linux)](https://travis-ci.org/mailgun/godebug)
5+
[![Windows Build Status](https://img.shields.io/appveyor/ci/jeremyschlatter/godebug.svg?label=windows)](https://ci.appveyor.com/project/jeremyschlatter/godebug)
6+
37

48
A cross-platform debugger for Go.
59

endtoend_cli_test.go

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package main
33
import (
44
"bytes"
55
"errors"
6+
"flag"
67
"fmt"
78
"io/ioutil"
89
"os"
@@ -16,9 +17,15 @@ import (
1617
"github.com/mailgun/godebug/Godeps/_workspace/src/gopkg.in/yaml.v2"
1718
)
1819

20+
var parallel = flag.Int("parallel-tests", 40, "Max number of CLI tests to run in parallel")
21+
1922
// This file runs tests in the testdata directory, excluding those in testdata/single-file-tests
2023

2124
func TestCLISessions(t *testing.T) {
25+
if !flag.Parsed() {
26+
flag.Parse()
27+
}
28+
2229
godebug := compileGodebug(t)
2330
defer os.Remove(godebug)
2431

@@ -42,7 +49,7 @@ func TestCLISessions(t *testing.T) {
4249
// Run tests in parallel
4350
var wg sync.WaitGroup
4451
// If we run too many tests at once we can exceed our file descriptor limit.
45-
lim := make(chan bool, 40)
52+
lim := make(chan bool, *parallel)
4653
for _, test := range tests {
4754
for _, tt := range parseCases(t, filepath.Join("testdata", test)) {
4855
s := parseSessionFromBytes([]byte(tt.Transcript))
@@ -220,15 +227,15 @@ func listToMap(list []string) map[string]bool {
220227
// equivalent does a linewise comparison of a and b.
221228
// For each line:
222229
// got exactly equals want OR
223-
// want ends in "//substr" and is a substring of got OR
224-
// want ends in "//slashes" and runtime.GOOS == "windows" and got equals want with its slashes swapped for backslashes
230+
// want ends in " //substr" and is a substring of got OR
231+
// want ends in " //slashes" and runtime.GOOS == "windows" and got equals want with its slashes swapped for backslashes
225232
// Otherwise equivalent returns false.
226233
func equivalent(got, want []byte) bool {
227234
var (
228235
gotLines = bytes.Split(got, newline)
229236
wantLines = bytes.Split(want, newline)
230-
substr = []byte("//substr")
231-
slashes = []byte("//slashes")
237+
substr = []byte(" //substr")
238+
slashes = []byte(" //slashes")
232239
slash = []byte{'/'}
233240
gg, ww []byte
234241
)

testdata/run.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,6 @@ creates:
352352
- $TMP/breakpointInDependency.go
353353

354354
transcript: |
355-
godebug run: Ignoring breakpoint at testpkg/pkg.go:4 because package "testpkg" has not been flagged for instrumentation. See 'godebug help run'.//slashes
355+
godebug run: Ignoring breakpoint at testpkg/pkg.go:4 because package "testpkg" has not been flagged for instrumentation. See 'godebug help run'. //slashes
356356
357357
finished running

testdata/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ creates:
204204
- $TMP/src/testpkg2/test_test.go
205205

206206
transcript: |
207-
godebug test: Ignoring breakpoint at foo/subfoo/subfoo.go:8 because package "subfoo" has not been flagged for instrumentation. See 'godebug help test'.//slashes
207+
godebug test: Ignoring breakpoint at foo/subfoo/subfoo.go:8 because package "subfoo" has not been flagged for instrumentation. See 'godebug help test'. //slashes
208208
209209
-> _ = "breakpoint"
210210
(godebug) n

0 commit comments

Comments
 (0)