Add list-tests protocol message, test subcommands, extract test handlers

This commit is contained in:
Ian Gulliver
2026-04-11 07:25:16 +09:00
parent f6d8847bcf
commit 34efaeefd5
8 changed files with 183 additions and 115 deletions

View File

@@ -117,6 +117,10 @@ func (c *Client) Log() (*ResponseLog, error) {
return first(roundTrip[ResponseLog](c, &RequestLog{}))
}
func (c *Client) ListTests() (*ResponseListTests, error) {
return first(roundTrip[ResponseListTests](c, &RequestListTests{}))
}
func (c *Client) Test(name string) (*ResponseTest, error) {
return first(roundTrip[ResponseTest](c, &RequestTest{Name: name}))
}

View File

@@ -24,6 +24,11 @@ type ResponseLog struct {
Entries []LogEntry
}
type RequestListTests struct{}
type ResponseListTests struct {
Names []string
}
type RequestTest struct {
Name string
}
@@ -57,6 +62,8 @@ func init() {
msgpack.RegisterExt(5, (*ResponseInfo)(nil))
msgpack.RegisterExt(6, (*RequestLog)(nil))
msgpack.RegisterExt(7, (*ResponseLog)(nil))
msgpack.RegisterExt(125, (*RequestListTests)(nil))
msgpack.RegisterExt(124, (*ResponseListTests)(nil))
msgpack.RegisterExt(127, (*RequestTest)(nil))
msgpack.RegisterExt(126, (*ResponseTest)(nil))
}