Skip to content

Commit a95793e

Browse files
committed
Remove dbg.regression option
1 parent 577110d commit a95793e

File tree

3 files changed

+6
-25
lines changed

3 files changed

+6
-25
lines changed

regtest.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if [[ $OSTYPE == 'darwin'* ]]; then
1414
grep="ggrep"
1515
fi
1616
params="`$grep -oP "PARAM: \K.*" $file`"
17-
cmd="./goblint --enable warn.debug --enable dbg.regression --html $params ${@:3} $file" # -v
17+
cmd="./goblint --enable warn.debug --html $params ${@:3} $file" # -v
1818
echo "$cmd"
1919
eval $cmd
2020
echo "See result/index.xml"

src/analyses/assert.ml

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,14 @@ struct
1515

1616
let assert_fn man e check refine =
1717
let expr = CilType.Exp.show e in
18-
let warn warn_fn ?annot msg = if check then
19-
if get_bool "dbg.regression" then ( (* This only prints unexpected results (with the difference) as indicated by the comment behind the assert (same as used by the regression test script). *)
20-
let loc = !M.current_loc in
21-
let line = List.at (List.of_enum @@ File.lines_of loc.file) (loc.line-1) in (* nosemgrep: batenum-of_enum *)
22-
let open Str in
23-
let expected = if string_match (regexp ".+//.*\\(FAIL\\|UNKNOWN\\).*") line 0 then Some (matched_group 1 line) else None in
24-
if expected <> annot then (
25-
let result = if annot = None && (expected = Some ("NOWARN") || (expected = Some ("UNKNOWN") && not (String.exists line "UNKNOWN!"))) then "improved" else "failed" in
26-
(* Expressions with logical connectives like a && b are calculated in temporary variables by CIL. Instead of the original expression, we then see something like tmp___0. So we replace expr in msg by the original source if this is the case. *)
27-
let assert_expr = if string_match (regexp ".*assert(\\(.+\\));.*") line 0 then matched_group 1 line else expr in
28-
let msg = if expr <> assert_expr then String.nreplace ~str:msg ~sub:expr ~by:assert_expr else msg in
29-
warn_fn (msg ^ " Expected: " ^ (expected |? "SUCCESS") ^ " -> " ^ result)
30-
)
31-
) else
32-
warn_fn msg
18+
let warn warn_fn msg =
19+
if check then
20+
warn_fn msg
3321
in
3422
(* TODO: use format instead of %s for the following messages *)
3523
match Queries.eval_bool (Analyses.ask_of_man man) e with
3624
| `Lifted false ->
37-
warn (M.error ~category:Assert "%s") ~annot:"FAIL" ("Assertion \"" ^ expr ^ "\" will fail.");
25+
warn (M.error ~category:Assert "%s") ("Assertion \"" ^ expr ^ "\" will fail.");
3826
if refine then raise Analyses.Deadcode else man.local
3927
| `Lifted true ->
4028
warn (M.success ~category:Assert "%s") ("Assertion \"" ^ expr ^ "\" will succeed");
@@ -43,7 +31,7 @@ struct
4331
M.error ~category:Assert "%s" ("Assertion \"" ^ expr ^ "\" produces a bottom. What does that mean? (currently uninitialized arrays' content is bottom)");
4432
man.local
4533
| `Top ->
46-
warn (M.warn ~category:Assert "%s") ~annot:"UNKNOWN" ("Assertion \"" ^ expr ^ "\" is unknown.");
34+
warn (M.warn ~category:Assert "%s") ("Assertion \"" ^ expr ^ "\" is unknown.");
4735
man.local
4836

4937
let special man (lval: lval option) (f:varinfo) (args:exp list) : D.t =

src/config/options.schema.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2202,13 +2202,6 @@
22022202
"type": "boolean",
22032203
"default": false
22042204
},
2205-
"regression": {
2206-
"title": "dbg.regression",
2207-
"description":
2208-
"Only output warnings for assertions that have an unexpected result (no comment, comment FAIL, comment UNKNOWN)",
2209-
"type": "boolean",
2210-
"default": false
2211-
},
22122205
"test": {
22132206
"title": "dbg.test",
22142207
"type": "object",

0 commit comments

Comments
 (0)