diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-07-07 09:06:48 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-07-07 10:40:55 +0200 |
| commit | f7b01f08a31f0ab533410a3ba3b74f781674e059 (patch) | |
| tree | 1c5789396db89c50ee301c12743f2f72da3734ae /pkg/vcs/linux_test.go | |
| parent | e419f4e6d851d09202e550ac2a5975ef68fd6935 (diff) | |
pkg/vcs: fix config bisection tests more
config-bisect.pl uses bash-isms and can't run on non-linux.
It also silently ignores all errors which made failures
very obscure -- the script happily succeeds in presence
of any errors. So the test failed later reading .config.
Use "set -eu" to not fail silently.
Also trace all config-bisect.pl invocations and output.
good/bad decisions are important and we always log them
in the normal bisection.
Diffstat (limited to 'pkg/vcs/linux_test.go')
| -rw-r--r-- | pkg/vcs/linux_test.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/vcs/linux_test.go b/pkg/vcs/linux_test.go index a249dc6c9..bacf89edb 100644 --- a/pkg/vcs/linux_test.go +++ b/pkg/vcs/linux_test.go @@ -8,6 +8,7 @@ import ( "fmt" "io/ioutil" "os" + "runtime" "strings" "testing" @@ -24,6 +25,10 @@ type MinimizationTest struct { } func TestConfigMinimizer(t *testing.T) { + if runtime.GOOS != "linux" { + // The test config-bisect.pl uses bash-isms and can't run on OS that don't have bash. + t.Skipf("skipping on non-linux") + } t.Parallel() tests := []MinimizationTest{ { @@ -67,6 +72,7 @@ func TestConfigMinimizer(t *testing.T) { trace := new(bytes.Buffer) outConfig, err := minimizer.Minimize([]byte(test.config), []byte(test.baselineConfig), trace, pred) + t.Log(trace.String()) if test.passing && err != nil { t.Fatalf("failed to run Minimize: %v", err) } else if test.passing && !strings.Contains(string(outConfig), @@ -74,7 +80,6 @@ func TestConfigMinimizer(t *testing.T) { t.Fatalf("output is not expected %v vs. %v", string(outConfig), test.expectedConfig) } - t.Log(trace.String()) }) } } |
