1
0

Implements reliablity threshold for exit code

This commit is contained in:
2019-08-30 00:33:43 +00:00
parent 5bad772125
commit 365c9d0e95
2 changed files with 17 additions and 3 deletions

15
pew.go
View File

@@ -26,7 +26,17 @@ import (
"code.dumpstack.io/tools/out-of-tree/qemu"
)
var somethingFailed = false
type runstate struct {
Overall, Success float64
}
var (
state runstate
)
func successRate(state runstate) float64 {
return state.Success / state.Overall
}
const pathDevNull = "/dev/null"
@@ -134,11 +144,12 @@ func testKernelExploit(q *qemu.System, ka config.Artifact,
}
func genOkFail(name string, ok bool) (aurv aurora.Value) {
state.Overall += 1
if ok {
state.Success += 1
s := " " + name + " SUCCESS "
aurv = aurora.BgGreen(aurora.Black(s))
} else {
somethingFailed = true
s := " " + name + " FAILURE "
aurv = aurora.BgRed(aurora.Gray(aurora.Bold(s)))
}