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:
parent
82d87ff8ed
commit
96750a7d3c
@ -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) {
|
||||||
|
@ -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
|
||||||
|
@ -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()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user