-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #787 from goblint/cram
Use Cram for tests
- Loading branch information
Showing
14 changed files
with
98 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Copy Promela model here. | ||
|
||
$ cp -r ../../spin ./spin | ||
|
||
Run Goblint extraction. | ||
|
||
$ goblint --set ana.activated[+] extract-pthread 00-sanity.c > /dev/null 2>&1 | ||
|
||
Run spin. | ||
|
||
$ (spin -a pml-result/pthread.pml && cc -o pan pan.c && ./pan -a) > out.txt 2>&1 | ||
|
||
Non-starving, should not have trail. | ||
|
||
$ grep pthread.pml.trail out.txt | ||
[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Copy Promela model here. | ||
|
||
$ cp -r ../../spin ./spin | ||
|
||
Run Goblint extraction. | ||
|
||
$ goblint --set ana.activated[+] extract-pthread 01-base.c > /dev/null 2>&1 | ||
|
||
Run spin. | ||
|
||
$ (spin -a pml-result/pthread.pml && cc -o pan pan.c && ./pan -a) > out.txt 2>&1 | ||
|
||
Starving, should have trail. | ||
|
||
$ grep pthread.pml.trail out.txt | ||
pan: wrote pthread.pml.trail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Copy Promela model here. | ||
|
||
$ cp -r ../../spin ./spin | ||
|
||
Run Goblint extraction. | ||
|
||
$ goblint --set ana.activated[+] extract-pthread 02-starve.c > /dev/null 2>&1 | ||
|
||
Run spin. | ||
|
||
$ (spin -a pml-result/pthread.pml && cc -o pan pan.c && ./pan -a) > out.txt 2>&1 | ||
|
||
Starving, should have trail. | ||
|
||
$ grep pthread.pml.trail out.txt | ||
pan: wrote pthread.pml.trail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
(cram | ||
(enabled_if %{bin-available:spin}) | ||
(deps %{bin:goblint} (package goblint) (glob_files *.c) (source_tree ../../spin))) ; need entire package for includes/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
(lang dune 3.0) | ||
; need 3.0 for bin-available, but cannot use 3.0 for entire project because https://github.com/johnwhitington/ppx_blob/issues/23 | ||
; TODO: remove when ppx_blob fixed |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
$ goblint 01-assert.c | ||
[Success][Assert] Assertion "success" will succeed (01-assert.c:10:3-10:28) | ||
[Warning][Assert] Assertion "unknown == 4" is unknown. (01-assert.c:11:3-11:33) | ||
[Error][Assert] Assertion "fail" will fail. (01-assert.c:12:3-12:25) | ||
Live lines: 7 | ||
[Warning][Deadcode] Function 'main' has dead code: | ||
on lines 13..14 (01-assert.c:13-14) | ||
Found dead code on 2 lines! | ||
Total lines (logical LoC): 9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
(cram | ||
(deps (glob_files *.c))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
$ goblint 01-simple_rc.c | ||
Live lines: 12 | ||
No lines with dead code found by solver. | ||
Total lines (logical LoC): 12 | ||
[Warning][Race] Memory location myglobal@01-simple_rc.c:4:5-4:13 (race with conf. 110): | ||
write with [mhp:{tid=[main, t_fun@01-simple_rc.c:17:3-17:40]}, | ||
lock:{mutex1}, thread:[main, t_fun@01-simple_rc.c:17:3-17:40]] (conf. 110) (01-simple_rc.c:10:3-10:22) | ||
write with [mhp:{tid=[main]; created={[main, t_fun@01-simple_rc.c:17:3-17:40]}}, lock:{mutex2}, thread:[main]] (conf. 110) (01-simple_rc.c:19:3-19:22) | ||
read with [mhp:{tid=[main, t_fun@01-simple_rc.c:17:3-17:40]}, lock:{mutex1}, thread:[main, t_fun@01-simple_rc.c:17:3-17:40]] (conf. 110) (01-simple_rc.c:10:3-10:22) | ||
read with [mhp:{tid=[main]; created={[main, t_fun@01-simple_rc.c:17:3-17:40]}}, lock:{mutex2}, thread:[main]] (conf. 110) (01-simple_rc.c:19:3-19:22) | ||
|
||
Summary for all memory locations: | ||
safe: 0 | ||
vulnerable: 0 | ||
unsafe: 1 | ||
------------------- | ||
total: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
(cram | ||
(deps (glob_files *.c))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
(cram | ||
(applies_to :whole_subtree) | ||
(deps %{bin:goblint} (package goblint))) ; need entire package for includes/ |