tests: exit with correct error code from TestMain

extpass_test and example_filesystems_test did it wrong,
always returning 0.
This commit is contained in:
Jakob Unterwurzacher 2016-06-16 21:56:23 +02:00
parent 82d87ff8ed
commit 96750a7d3c
3 changed files with 7 additions and 3 deletions

View File

@ -11,7 +11,7 @@ import (
func TestMain(m *testing.M) { func TestMain(m *testing.M) {
// Shut up info output // Shut up info output
tlog.Info.Enabled = false tlog.Info.Enabled = false
m.Run() os.Exit(m.Run())
} }
func TestExtpass(t *testing.T) { func TestExtpass(t *testing.T) {

View File

@ -15,7 +15,7 @@ const statusTxtContent = "It works!\n"
func TestMain(m *testing.M) { func TestMain(m *testing.M) {
test_helpers.ResetTmpDir(true) test_helpers.ResetTmpDir(true)
m.Run() os.Exit(m.Run())
} }
// checkExampleFS - verify that "dir" contains the expected test files // checkExampleFS - verify that "dir" contains the expected test files

View File

@ -109,7 +109,11 @@ func Mount(c string, p string, extraArgs ...string) error {
cmd := exec.Command(GocryptfsBinary, args...) cmd := exec.Command(GocryptfsBinary, args...)
cmd.Stderr = os.Stderr cmd.Stderr = os.Stderr
cmd.Stdout = os.Stdout if testing.Verbose() {
// Don't show the "deprecated filesystem" warnings by default. These
// are not silenced by "-q".
cmd.Stdout = os.Stdout
}
return cmd.Run() return cmd.Run()
} }