diff options
Diffstat (limited to 'tools/http2_interop/http2interop_test.go')
-rw-r--r-- | tools/http2_interop/http2interop_test.go | 44 |
1 files changed, 36 insertions, 8 deletions
diff --git a/tools/http2_interop/http2interop_test.go b/tools/http2_interop/http2interop_test.go index b35d085569..fb314da196 100644 --- a/tools/http2_interop/http2interop_test.go +++ b/tools/http2_interop/http2interop_test.go @@ -3,6 +3,7 @@ package http2interop import ( "crypto/tls" "crypto/x509" + "encoding/json" "flag" "fmt" "io/ioutil" @@ -67,7 +68,8 @@ func (ctx *HTTP2InteropCtx) Close() error { return nil } -func TestClientShortSettings(t *testing.T) { +func TestSoonClientShortSettings(t *testing.T) { + defer Report(t) if *testCase != "framing" { t.SkipNow() } @@ -78,7 +80,8 @@ func TestClientShortSettings(t *testing.T) { } } -func TestShortPreface(t *testing.T) { +func TestSoonShortPreface(t *testing.T) { + defer Report(t) if *testCase != "framing" { t.SkipNow() } @@ -89,7 +92,8 @@ func TestShortPreface(t *testing.T) { } } -func TestUnknownFrameType(t *testing.T) { +func TestSoonUnknownFrameType(t *testing.T) { + defer Report(t) if *testCase != "framing" { t.SkipNow() } @@ -99,7 +103,8 @@ func TestUnknownFrameType(t *testing.T) { } } -func TestClientPrefaceWithStreamId(t *testing.T) { +func TestSoonClientPrefaceWithStreamId(t *testing.T) { + defer Report(t) if *testCase != "framing" { t.SkipNow() } @@ -108,7 +113,8 @@ func TestClientPrefaceWithStreamId(t *testing.T) { matchError(t, err, "EOF") } -func TestTLSApplicationProtocol(t *testing.T) { +func TestSoonTLSApplicationProtocol(t *testing.T) { + defer Report(t) if *testCase != "tls" { t.SkipNow() } @@ -117,7 +123,8 @@ func TestTLSApplicationProtocol(t *testing.T) { matchError(t, err, "EOF", "broken pipe") } -func TestTLSMaxVersion(t *testing.T) { +func TestSoonTLSMaxVersion(t *testing.T) { + defer Report(t) if *testCase != "tls" { t.SkipNow() } @@ -128,7 +135,8 @@ func TestTLSMaxVersion(t *testing.T) { matchError(t, err, "EOF", "server selected unsupported protocol") } -func TestTLSBadCipherSuites(t *testing.T) { +func TestSoonTLSBadCipherSuites(t *testing.T) { + defer Report(t) if *testCase != "tls" { t.SkipNow() } @@ -151,5 +159,25 @@ func matchError(t *testing.T, err error, matches ...string) { func TestMain(m *testing.M) { flag.Parse() - os.Exit(m.Run()) + 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) + } + var code int + if !any || fatal { + code = 1 + } + os.Exit(code) } |