Skip to content

Commit 86de08f

Browse files
romainbrenguierJoel Allred
authored and
Joel Allred
committed
Update strings-smoke-test
Script to gather performances on string tests Draw graphs in a png file. The file name contains the date and commit.
1 parent 12c5f26 commit 86de08f

File tree

11 files changed

+82
-12
lines changed

11 files changed

+82
-12
lines changed
+32-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,38 @@
1+
default: tests.log
12

23
test:
3-
@../test.pl -c ../../../src/cbmc/cbmc
4+
@if ! ../test.pl -c ../../../src/cbmc/cbmc ; then \
5+
../failed-tests-printer.pl ; \
6+
exit 1 ; \
7+
fi
48

59
testfuture:
6-
@../test.pl -c ../../../src/cbmc/cbmc -CF
10+
@if ! ../test.pl -c ../../../src/cbmc/cbmc -CF ; then \
11+
../failed-tests-printer.pl ; \
12+
exit 1 ; \
13+
fi
714

815
testall:
9-
@../test.pl -c ../../../src/cbmc/cbmc -CFTK
16+
@if ! ../test.pl -c ../../../src/cbmc/cbmc -CFTK ; then \
17+
../failed-tests-printer.pl ; \
18+
exit 1 ; \
19+
fi
20+
21+
tests.log: ../test.pl
22+
@if ! ../test.pl -c ../../../src/cbmc/cbmc ; then \
23+
../failed-tests-printer.pl ; \
24+
exit 1 ; \
25+
fi
26+
27+
show:
28+
@for dir in *; do \
29+
if [ -d "$$dir" ]; then \
30+
vim -o "$$dir/*.c" "$$dir/*.out"; \
31+
fi; \
32+
done;
33+
34+
clean:
35+
find -name '*.out' -execdir $(RM) '{}' \;
36+
find -name '*.gb' -execdir $(RM) '{}' \;
37+
$(RM) tests.log
38+

regression/strings-smoke-tests/java_append_int/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
FUTURE
22
test_append_int.class
33
--refine-strings
44
^EXIT=0$
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
KNOWNBUG
1+
CORE
22
test_contains.class
33
--refine-strings
4-
^EXIT=10$
4+
^EXIT=0$
55
^SIGNAL=0$
66
^\[.*assertion.1\].* line 8.* SUCCESS$
7-
^\[.*assertion.2\].* line 9.* FAILURE$
87
--
98
Issue: diffblue/test-gen#201
Binary file not shown.

regression/strings-smoke-tests/java_contains/test_contains.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ public static void main(/*String[] argv*/)
66
String u = "bc";
77
String t = "ab";
88
assert(s.contains(u));
9-
assert(s.contains(t));
9+
// Long version:
10+
// assert(s.contains(t));
1011
}
1112
}

regression/strings-smoke-tests/java_endswith/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
test_endswith.class
3-
--refine-strings
3+
--refine-strings --string-max-length 100
44
^EXIT=10$
55
^SIGNAL=0$
66
^\[.*assertion.1\].* line 9.* SUCCESS$

regression/strings-smoke-tests/java_float/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
FUTURE
22
test_float.class
33
--refine-strings
44
^EXIT=0$

regression/strings-smoke-tests/java_insert_int/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
FUTURE
22
test_insert_int.class
33
--refine-strings
44
^EXIT=0$
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/python
2+
3+
'''
4+
This script collects the running times of the tests present in the current
5+
directory.
6+
7+
It does not run the tests but reads the already present output files.
8+
9+
Usage:
10+
python performance.py
11+
12+
Dependencies:
13+
gnuplot http://www.gnuplot.info/
14+
'''
15+
16+
import time
17+
from subprocess import check_output
18+
from subprocess import check_call
19+
20+
git_output = check_output(['git', 'show', 'HEAD'])
21+
commit = git_output.split('\n')[0]
22+
commit_id = time.strftime('%Y_%m_%d__%H_%M_%S')+'__'+commit[7:]
23+
24+
process = check_output(['grep', '^Runtime decision procedure', '-R'])
25+
file_name = 'performance_'+commit_id+'.out'
26+
27+
print 'writing to file', file_name
28+
29+
with open(file_name, 'w') as f:
30+
f.write(process)
31+
32+
print('drawing to file', file_name+'.png')
33+
check_call(['gnuplot', '-e', 'file="'+file_name+'"', '-e',
34+
'outputfile="'+file_name+'.png"', 'performance_draw.gp'])
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
set datafile separator ":"
2+
set term png
3+
set output outputfile
4+
set logscale y 10
5+
set yrange [0.01:100]
6+
7+
plot file using 3 with lines

regression/strings/StringValueOf08/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FUTURE
22
StringValueOf08.class
3-
--refine-strings
3+
--refine-strings --string-max-length 100
44
^EXIT=10$
55
^SIGNAL=0$
66
^VERIFICATION FAILED$

0 commit comments

Comments
 (0)