Skip to content

Commit 3344430

Browse files
author
Peter Schrammel
committed
basic tests for fault localization
1 parent ce035c4 commit 3344430

File tree

7 files changed

+76
-0
lines changed

7 files changed

+76
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
default: tests.log
2+
3+
test:
4+
@if ! ../test.pl -c ../../../src/cbmc/cbmc ; then \
5+
../failed-tests-printer.pl ; \
6+
exit 1 ; \
7+
fi
8+
9+
tests.log: ../test.pl
10+
@if ! ../test.pl -c ../../../src/cbmc/cbmc ; then \
11+
../failed-tests-printer.pl ; \
12+
exit 1 ; \
13+
fi
14+
15+
show:
16+
@for dir in *; do \
17+
if [ -d "$$dir" ]; then \
18+
vim -o "$$dir/*.c" "$$dir/*.out"; \
19+
fi; \
20+
done;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#include <assert.h>
2+
3+
void main()
4+
{
5+
int x, c;
6+
if(c) x=0;
7+
else x++;
8+
assert(x==0);
9+
assert(x!=0);
10+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
main.c
3+
--localize-faults
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
line 7 function main$
7+
line 6 function main$
8+
^VERIFICATION FAILED$
9+
--
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#include <assert.h>
2+
3+
void main()
4+
{
5+
int x, c;
6+
if(c) x=0;
7+
else x++;
8+
assert(x==0);
9+
assert(x==0 || c==0);
10+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
main.c
3+
--localize-faults
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
line 7 function main$
7+
^VERIFICATION FAILED$
8+
--
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#include <assert.h>
2+
3+
void main()
4+
{
5+
int x, c;
6+
if(c) x=0;
7+
else x++;
8+
assert(x==0);
9+
assert(x!=0);
10+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
main.c
3+
--localize-faults --stop-on-fail
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^\[main.assertion.1\]:
7+
line . function main$
8+
^VERIFICATION FAILED$
9+
--

0 commit comments

Comments
 (0)