diff options
author | Carl Mastrangelo <notcarl@google.com> | 2015-12-04 16:49:33 -0800 |
---|---|---|
committer | Carl Mastrangelo <notcarl@google.com> | 2015-12-04 16:49:33 -0800 |
commit | 3e21ba493bed6004037c1b8f8e3e9261c1f1d1e5 (patch) | |
tree | 654005e5e30cab8985c1388c74a7a6626949294d /tools/http2_interop/http2interop_test.go | |
parent | 3c7862478d9da829199714e645b6c5a15fb7f596 (diff) |
Add optional passing more
Diffstat (limited to 'tools/http2_interop/http2interop_test.go')
-rw-r--r-- | tools/http2_interop/http2interop_test.go | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/tools/http2_interop/http2interop_test.go b/tools/http2_interop/http2interop_test.go index 2295340286..e04c914d05 100644 --- a/tools/http2_interop/http2interop_test.go +++ b/tools/http2_interop/http2interop_test.go @@ -69,7 +69,7 @@ func (ctx *HTTP2InteropCtx) Close() error { } func TestClientShortSettings(t *testing.T) { - defer Report(t)() + defer Report(t) if *testCase != "framing" { t.SkipNow() } @@ -81,7 +81,7 @@ func TestClientShortSettings(t *testing.T) { } func TestShortPreface(t *testing.T) { - defer Report(t)() + defer Report(t) if *testCase != "framing" { t.SkipNow() } @@ -93,7 +93,7 @@ func TestShortPreface(t *testing.T) { } func TestUnknownFrameType(t *testing.T) { - defer Report(t)() + defer Report(t) if *testCase != "framing" { t.SkipNow() } @@ -104,7 +104,7 @@ func TestUnknownFrameType(t *testing.T) { } func TestClientPrefaceWithStreamId(t *testing.T) { - defer Report(t)() + defer Report(t) if *testCase != "framing" { t.SkipNow() } @@ -114,7 +114,7 @@ func TestClientPrefaceWithStreamId(t *testing.T) { } func TestTLSApplicationProtocol(t *testing.T) { - defer Report(t)() + defer Report(t) if *testCase != "tls" { t.SkipNow() } @@ -124,7 +124,7 @@ func TestTLSApplicationProtocol(t *testing.T) { } func TestTLSMaxVersion(t *testing.T) { - defer Report(t)() + defer Report(t) if *testCase != "tls" { t.SkipNow() } @@ -136,7 +136,7 @@ func TestTLSMaxVersion(t *testing.T) { } func TestTLSBadCipherSuites(t *testing.T) { - defer Report(t)() + defer Report(t) if *testCase != "tls" { t.SkipNow() } @@ -160,9 +160,24 @@ func matchError(t *testing.T, err error, matches ...string) { func TestMain(m *testing.M) { flag.Parse() m.Run() + var fatal bool + var any bool + for _, ci := range allCaseInfos.Cases { + if ci.Skipped { + continue + } + any = true + if !ci.Passed && ci.Fatal { + fatal = true + } + } + if err := json.NewEncoder(os.Stderr).Encode(&allCaseInfos); err != nil { fmt.Println("Failed to encode", err) } - // Always pass - os.Exit(0) + var code int + if !any || fatal { + code = 1 + } + os.Exit(code) } |