Commit 8ee01a27 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 39b3d8c7
...@@ -92,7 +92,7 @@ func routeEvent(event interface{}) (stream string) { ...@@ -92,7 +92,7 @@ func routeEvent(event interface{}) (stream string) {
// verify calls tracetest.Verify on f with first preparing tracing setup and events delivery. // verify calls tracetest.Verify on f with first preparing tracing setup and events delivery.
// It also verifies that tracetest detects errors as expected. // It also verifies that tracetest detects errors as expected.
func verify(t *testing.T, f func(t *tracetest.T), targvExtra ...string) { func verify(t *testing.T, f func(t *tracetest.T), targvExtra ...string) {
// XXX t.Helper() ? t.Helper()
verifyInSubprocess(t, func (t *testing.T) { verifyInSubprocess(t, func (t *testing.T) {
tracetest.Verify(t, func(t *tracetest.T) { tracetest.Verify(t, func(t *tracetest.T) {
// setup tracing to deliver trace events to t. // setup tracing to deliver trace events to t.
...@@ -185,13 +185,16 @@ func verifyInSubprocess(t *testing.T, f func(t *testing.T), targvExtra ...string ...@@ -185,13 +185,16 @@ func verifyInSubprocess(t *testing.T, f func(t *testing.T), targvExtra ...string
cmd.Env = append(os.Environ(), "TRACETEST_EX_VERIFY_IN_SUBPROCESS=1") cmd.Env = append(os.Environ(), "TRACETEST_EX_VERIFY_IN_SUBPROCESS=1")
bout, err := cmd.CombinedOutput() bout, err := cmd.CombinedOutput()
out := string(bout) out := string(bout)
e, ok := err.(*exec.ExitError) ecode := 0
if !ok { if err != nil {
// e.g. could not respawn at all e, ok := err.(*exec.ExitError)
t.Log(out) if !ok {
t.Fatal(err) // e.g. could not respawn at all
t.Log(out)
t.Fatal(err)
}
ecode = e.ExitCode()
} }
ecode := e.ExitCode()
bad := "" bad := ""
badf := func(format string, argv ...interface{}) { badf := func(format string, argv ...interface{}) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment