Failed test runs of sqlboiler are left around

- Don't clean up, and print the location of the test run so that we can
  inspect the compilation failures that have occurred.
This commit is contained in:
Aaron L 2016-07-12 20:00:13 -07:00
parent 7cdf44376b
commit f054f2f754

View file

@ -136,7 +136,14 @@ func TestTemplates(t *testing.T) {
if err != nil {
t.Fatalf("Unable to create tempdir: %s", err)
}
defer os.RemoveAll(state.Config.OutFolder)
defer func() {
if t.Failed() {
t.Log("template test output:", state.Config.OutFolder)
return
}
os.RemoveAll(state.Config.OutFolder)
}()
if err = state.Run(true); err != nil {
t.Errorf("Unable to run SQLBoilerRun: %s", err)