-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes for Pull Request bench#85: Automatic Generation of Test Cases for Incremental Static Analysis #1096
Changes from all commits
15f3dfd
9de3f7a
e8cf76c
5b03ce8
6091f1d
1111331
acd5e06
2ea12fc
a0ca99c
922dd23
5f16ec1
ad9f0d9
eba6d46
1592efe
03868cb
4f0299b
dd69c3a
c63a024
1e71c0b
ac053d8
5958abb
6702b56
5583a91
7875a58
7d41ae4
a2d4bee
e5483b0
507fe12
31d39cf
f55aebe
d35ef36
28f5976
453da2c
f99fc76
36a2b21
6c1ae58
09d91ca
aea65aa
11fb212
213ee8d
d3cf3ef
ab3b973
5a78a05
ca13c9e
540565b
13875a1
d0760eb
5d06a6d
539ae63
488519f
0742b4f
0e2dd7e
d9e25e7
9cc1e8c
c9f5e6e
1821e93
112850d
b7252e1
d7a3dd8
d2cb173
e1887da
0bdda1f
26917ca
d2cc0c3
a6368ee
7bb727b
5295752
46405f5
b64399d
1068617
09553e8
edda276
402edb3
ae67de8
545a8dc
7718a50
a1f9eed
0708341
ce1e0d4
ea3edf8
3d7be0f
134a17d
d0ea8c2
79b953c
7f63d28
fe961f7
d845082
304d289
8db02d2
83144bf
df9ad70
16c8b9e
3e86606
9ff18ed
5671ed4
8873ab2
feade93
de00d79
44932c8
b7f33e6
4bac14d
49d71b1
7a96981
6633ada
8ea7618
cc64c2d
9d33c22
9001024
764482c
bbbfaf7
075c1a8
b4c84b0
63fb6bf
7e2491a
52ee2f8
3ba9149
b942b21
e11b135
4bc1729
73011a8
1c5871f
184e900
5de6d6c
757b85c
f8cbdb3
fddcfb1
1c5c355
8aabe2d
d3835f2
cb0ddb6
558b68e
f11f84e
097a42a
15e1896
840d587
7e8e216
9bf2959
698111f
692e8a0
474010b
40a9f80
f4412f8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,6 +53,7 @@ Comments at the end of other lines indicate the behavior on that line: | |
| `DEADLOCK` | Deadlock warning | Deadlock is possible | Soundness | | ||
| `NOWARN` | No warning | — | Precision | | ||
| `WARN` | Some warning | — | Soundness | | ||
| `NOFAIL` | Assertion is unknown <br> or succeeds | Everything except fail | Incremental analysis | | ||
|
||
#### Other | ||
Other useful constructs are the following: | ||
|
@@ -136,6 +137,9 @@ git diff --no-prefix relative/path/to/test.c relative/path/to/test.json > relati | |
|
||
The comparison input and the metadata in the patch headers are not necessary and can be removed. | ||
|
||
### Test Automation for Incremental Analysis - TAIA | ||
The "Test Automation for Incremental Analysis" in the bench repository (`bench/incremental-analysis-test-toolchain`) enables you to generate and run incremental tests based on one single c file as input. You find more details in the readme file in the repository (`bench/incremental-analysis-test-toolchain/README.md`). | ||
Comment on lines
+140
to
+141
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This refers to the unmerged goblint/bench#58. If that isn't merged, our documentation probably shouldn't refer people to non-existent things. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The plan would be to merge it. It is very self-contained, there are few things one would like to change before merging. |
||
|
||
## Unit tests | ||
|
||
### Running | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -221,6 +221,8 @@ def compare_warnings | |
check.call warnings[idx] != "race" | ||
when "nodeadlock" | ||
check.call warnings[idx] != "deadlock" | ||
when "nofail" | ||
check.call(warnings[idx] != "fail") | ||
end | ||
end | ||
end | ||
|
@@ -300,33 +302,43 @@ def parse_tests (lines) | |
i = $1.to_i - 1 | ||
end | ||
next if obj =~ /^\s*\/\// || obj =~ /^\s*\/\*([^*]|\*+[^*\/])*\*\/$/ | ||
todo << i if obj =~ /TODO|SKIP/ | ||
todo << i if obj =~ /(\b|\/)(TODO|SKIP)/ | ||
tests_line[i] = obj | ||
if obj =~ /RACE/ then | ||
tests[i] = if obj =~ /NORACE/ then "norace" else "race" end | ||
elsif obj =~ /DEADLOCK/ then | ||
tests[i] = if obj =~ /NODEADLOCK/ then "nodeadlock" else "deadlock" end | ||
elsif obj =~ /WARN/ then | ||
tests[i] = if obj =~ /NOWARN/ then "nowarn" else "warn" end | ||
elsif obj =~ /SUCCESS/ then | ||
if obj =~ /(\b|\/)NOFAIL/ then | ||
tests[i] = "nofail" | ||
elsif obj =~ /(\b|\/)RACE/ then | ||
tests[i] = "race" | ||
elsif obj =~ /(\b|\/)NORACE/ then | ||
tests[i] = "norace" | ||
elsif obj =~ /(\b|\/)DEADLOCK/ then | ||
tests[i] = "deadlock" | ||
elsif obj =~ /(\b|\/)NODEADLOCK/ then | ||
tests[i] = "nodeadlock" | ||
elsif obj =~ /(\b|\/)WARN/ then | ||
tests[i] = "warn" | ||
elsif obj =~ /(\b|\/)NOWARN/ then | ||
tests[i] = "nowarn" | ||
elsif obj =~ /(\b|\/)SUCCESS/ then | ||
tests[i] = "success" | ||
elsif obj =~ /FAIL/ then | ||
elsif obj =~ /(\b|\/)FAIL/ then | ||
tests[i] = "fail" | ||
elsif obj =~ /NONTERMLOOP/ then | ||
elsif obj =~ /(\b|\/)NONTERMLOOP/ then | ||
tests[i] = "loop" | ||
elsif obj =~ /NONTERMGOTO/ then | ||
elsif obj =~ /(\b|\/)NONTERMGOTO/ then | ||
tests[i] = "goto" | ||
elsif obj =~ /NONTERMFUNDEC/ then | ||
elsif obj =~ /(\b|\/)NONTERMFUNDEC/ then | ||
tests[i] = "fundec" | ||
elsif obj =~ /UNKNOWN/ then | ||
elsif obj =~ /(\b|\/)UNKNOWN/ then | ||
tests[i] = "unknown" | ||
elsif obj =~ /(assert|__goblint_check).*\(/ then | ||
if obj =~ /FAIL/ then | ||
tests[i] = "fail" | ||
elsif obj =~ /UNKNOWN/ then | ||
tests[i] = "unknown" | ||
else | ||
tests[i] = "assert" | ||
elsif obj =~ /(\b|\/)(assert|__goblint_check).*\(/ then | ||
unless obj =~ /^\s*extern\b/ | ||
Comment on lines
+333
to
+334
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is about an extern definition of 'goblint_check', which would otherwise also be matched. |
||
if obj =~ /(\b|\/)FAIL/ then | ||
tests[i] = "fail" | ||
elsif obj =~ /(\b|\/)UNKNOWN/ then | ||
tests[i] = "unknown" | ||
else | ||
tests[i] = "assert" | ||
end | ||
end | ||
end | ||
end | ||
|
@@ -376,6 +388,7 @@ def run_testset (testset, cmd, starttime) | |
lastline = (File.readlines testset.warnfile).last() | ||
filename = File.basename(@path) | ||
puts lastline.strip().sub filename, relpath(@path).to_s unless lastline.nil? | ||
puts "Content of the warn-file: \n #{File.read(testset.warnfile)}" | ||
puts stats[0..9].itemize | ||
elsif status == 3 then | ||
warn = File.readlines testset.warnfile | ||
|
@@ -565,9 +578,10 @@ def run () | |
config_path = File.expand_path(f[0..-3] + ".json", grouppath) | ||
params = if cfg then "--conf #{config_path} --set incremental.compare cfg" else "--conf #{config_path}" end | ||
else | ||
lines[0] =~ /PARAM: (.*)$/ | ||
if $1 then params = $1 else params = "" end | ||
params = "" | ||
end | ||
lines[0] =~ /PARAM: (.*)$/ | ||
if $1 then params << " #{$1}" else params << "" end | ||
# always enable debugging so that the warnings would work | ||
params << " --set warn.debug true" | ||
p = if incremental then | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Do not consider temporary files for the running of the "Test Automation for Incremental Analysis" | ||
99-temp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the meaning of "Everything except fail" as concrete semantics? Isn't that just "Assertion succeeds"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may succeed or be unknown. It is what one expects for an incremental run if the assert was proven in a from-scratch run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's in our abstract semantics, but in the concrete the assertion either fails or it succeeds. So it should be "Assertion may both succeed or fail"?