diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-07-01 17:41:15 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-07-02 10:56:05 +0200 |
| commit | 39ffeee9d8f9f2d27899311d06591a7ffaba3b26 (patch) | |
| tree | 00980993d555840f2221a3e5e43a498285d4ac92 /pkg/vcs | |
| parent | 85317734479539f614252c79b1e5c1445eedf8a7 (diff) | |
pkg/bisect: improve config minimization tests
Change a test to actually produce a new config as it is supposed
to do during config minimization and check the resulting config.
Add a regression test for the bug where we committed a broken config.
Diffstat (limited to 'pkg/vcs')
| -rw-r--r-- | pkg/vcs/testos.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/pkg/vcs/testos.go b/pkg/vcs/testos.go index c8746a684..ea369f529 100644 --- a/pkg/vcs/testos.go +++ b/pkg/vcs/testos.go @@ -30,8 +30,14 @@ func (ctx *testos) EnvForCommit(binDir, commit string, kernelConfig []byte) (*Bi func (ctx *testos) Minimize(original, baseline []byte, trace io.Writer, pred func(test []byte) (BisectResult, error)) ([]byte, error) { - if string(baseline) == "minimize-fails" { + switch string(baseline) { + case "minimize-fails": return nil, fmt.Errorf("minimization failure") + case "minimize-succeeds": + return []byte("new-minimized-config"), nil + case "baseline-broken-build": + return []byte("broken-build"), nil + default: + return original, nil } - return original, nil } |
