mirror of
https://github.com/safing/portmaster
synced 2025-09-01 18:19:12 +00:00
Only run tests if start hook succeeds
This commit is contained in:
parent
985e770c27
commit
81d2b6309d
1 changed files with 7 additions and 2 deletions
|
@ -81,14 +81,19 @@ func TestMainWithHooks(m *testing.M, module *modules.Module, afterStartFn, befor
|
|||
fmt.Fprintf(os.Stderr, "failed to setup test: %s\n", err)
|
||||
exitCode = 1
|
||||
} else {
|
||||
runTests := true
|
||||
if afterStartFn != nil {
|
||||
if err := afterStartFn(); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "failed to run test start hook: %s\n", err)
|
||||
runTests = false
|
||||
exitCode = 1
|
||||
}
|
||||
}
|
||||
// run tests
|
||||
exitCode = m.Run()
|
||||
|
||||
if runTests {
|
||||
// run tests
|
||||
exitCode = m.Run()
|
||||
}
|
||||
}
|
||||
|
||||
if beforeStopFn != nil {
|
||||
|
|
Loading…
Add table
Reference in a new issue