aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/runtest
diff options
context:
space:
mode:
authorAlexander Potapenko <glider@google.com>2024-07-25 13:13:15 +0200
committerAlexander Potapenko <glider@google.com>2024-07-26 10:55:23 +0000
commit2b4812a472dc793e954fa71a1b61773a428bdf88 (patch)
tree4ff0cfd4aa2534fc314f58426bc964ca62aaa2a0 /pkg/runtest
parent7b1976c40a6040d56b528206755fb746383aebe7 (diff)
pkg/runtest: report invalid programs as failing
Instead of bailing out on the first program with e.g. parsing errors, create a "failing" runRequest for each of such programs.
Diffstat (limited to 'pkg/runtest')
-rw-r--r--pkg/runtest/run.go20
1 files changed, 15 insertions, 5 deletions
diff --git a/pkg/runtest/run.go b/pkg/runtest/run.go
index e0fefc31a..62d11ebdb 100644
--- a/pkg/runtest/run.go
+++ b/pkg/runtest/run.go
@@ -42,9 +42,10 @@ type runRequest struct {
results *flatrpc.ProgInfo // the expected results
repeat int // only relevant for C tests
- name string
- broken string
- skip string
+ name string
+ broken string
+ failing string
+ skip string
}
type Context struct {
@@ -84,6 +85,10 @@ func (ctx *Context) Run(waitCtx context.Context) error {
broken++
result = fmt.Sprintf("BROKEN (%v)", req.broken)
verbose = true
+ } else if req.failing != "" {
+ fail++
+ result = fmt.Sprintf("FAIL (%v)", req.failing)
+ verbose = true
} else if req.skip != "" {
skip++
result = fmt.Sprintf("SKIP (%v)", req.skip)
@@ -178,7 +183,12 @@ func (ctx *Context) generatePrograms() error {
}
for _, file := range files {
if err := ctx.generateFile(sandboxes, cover, file); err != nil {
- return err
+ // Treat invalid programs as failing.
+ ctx.createTest(&runRequest{
+ name: file,
+ failing: err.Error(),
+ })
+ continue
}
}
return nil
@@ -398,7 +408,7 @@ func (ctx *Context) produceTest(req *runRequest, name string, properties,
func (ctx *Context) createTest(req *runRequest) {
req.executor = ctx.executor.Append()
ctx.requests = append(ctx.requests, req)
- if req.skip != "" || req.broken != "" {
+ if req.skip != "" || req.broken != "" || req.failing != "" {
return
}
if req.sourceOpts == nil {