From 8ab5df4cdd8d9267964d302ec4dfb544b4215351 Mon Sep 17 00:00:00 2001 From: Ray Myers Date: Thu, 6 Apr 2023 22:04:09 -0500 Subject: [PATCH] Exit with failure code with faults were found --- main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 0a6ece3..02d2070 100644 --- a/main.go +++ b/main.go @@ -132,7 +132,7 @@ func run(filepath string, mode string, input string, reach bool) { } if !compiler.IsValid { - fmt.Println("Fault found nothing to run. Missing run block or start block.") + log.Fatal("Fault found nothing to run. Missing run block or start block.") return } @@ -154,6 +154,7 @@ func run(filepath string, mode string, input string, reach bool) { mc.LoadMeta(generator.GetForks()) fmt.Println("~~~~~~~~~~\n Fault found the following scenario\n~~~~~~~~~~") mc.Format(data) + os.Exit(1) } case "ll": generator := smt2(d, 0, uncertains, unknowns, nil, nil) @@ -171,6 +172,7 @@ func run(filepath string, mode string, input string, reach bool) { mc.LoadMeta(generator.GetForks()) fmt.Println("~~~~~~~~~~\n Fault found the following scenario\n~~~~~~~~~~") mc.Format(data) + os.Exit(1) } case "smt2": mc, data := probability(d, uncertains, unknowns, make(map[string][]*smtvar.VarChange)) @@ -182,6 +184,7 @@ func run(filepath string, mode string, input string, reach bool) { if data != nil { fmt.Println("~~~~~~~~~~\n Fault found the following scenario\n~~~~~~~~~~") mc.Format(data) + os.Exit(1) } } }