Skip to content

Commit 123fd85

Browse files
author
Daniel Kroening
committed
Merge pull request #96 from marcelosousa/regression-script-changes
added script to run datastax benchmarks and changed test.pl to suppor…
2 parents 3309d9c + f02d8b3 commit 123fd85

File tree

2 files changed

+36
-17
lines changed

2 files changed

+36
-17
lines changed

regression/run-datastax.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
test_cases=`find cbmc-java/datastax/ -name *.desc -exec dirname {} \;`
3+
./test.pl -c $1 ${test_cases}
4+
5+
count=0
6+
for test_case in ${test_cases}; do
7+
out_file=`find ${test_case} -name '*.out'`
8+
if grep -q "identifier.*not found" ${out_file}; then
9+
echo ${out_file}
10+
count=$((${count}+1))
11+
fi
12+
done;
13+
echo "Missing symbols: ${count}"

regression/test.pl

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ ($)
5959

6060
sub test($$$$$) {
6161
my ($name, $test, $t_level, $cmd, $ign) = @_;
62-
my ($level, $input, $options, @results) = load("$name/$test");
62+
my ($level, $input, $options, @results) = load("$test");
6363
$options =~ s/$ign//g if(defined($ign));
6464

6565
my $output = $input;
@@ -107,7 +107,7 @@ ($$$$$)
107107
my $r;
108108
$result =~ s/\\/\\\\/g;
109109
$result =~ s/([^\\])\$/$1\\r\\\\?\$/;
110-
system("bash", "-c", "grep \$'$result' '$name/$output' >/dev/null");
110+
system("bash", "-c", "grep \$'$result' \"$name/$output\" >/dev/null");
111111
$r = ($included ? $? != 0 : $? == 0);
112112
if($r) {
113113
print LOG "$result [FAILED]\n";
@@ -212,7 +212,11 @@ ($$$$)
212212

213213
print "Loading\n";
214214
my @tests = @ARGV != 0 ? @ARGV : dirs();
215-
my $count = @tests;
215+
my $count = 0;
216+
for (@tests){
217+
my @testfiles = glob "$_/*desc";
218+
$count += $#testfiles+1;
219+
}
216220
print " $count " . (1==$count?"test":"tests") . " found\n\n";
217221

218222
use Cwd qw(getcwd);
@@ -225,20 +229,22 @@ ($)
225229
{
226230
my ($test) = @_;
227231
my $failed_skipped = 0;
228-
229-
defined($pool) or print " Running $test";
230-
$failed_skipped = test($test, "test.desc", $t_level, $opt_c, $opt_i);
231-
232-
lock($skips);
233-
defined($pool) and print " Running $test";
234-
if(2 == $failed_skipped) {
235-
$skips++;
236-
print " [SKIPPED]\n";
237-
} elsif(0 == $failed_skipped) {
238-
print " [OK]\n";
239-
} else {
240-
$failures++;
241-
print " [FAILED]\n";
232+
my @files = glob "$test/*.desc";
233+
for (0..$#files){
234+
defined($pool) or print " Running $files[$_]";
235+
$failed_skipped = test($test, $files[$_], $t_level, $opt_c, $opt_i);
236+
237+
lock($skips);
238+
defined($pool) and print " Running $test $files[$_]";
239+
if(2 == $failed_skipped) {
240+
$skips++;
241+
print " [SKIPPED]\n";
242+
} elsif(0 == $failed_skipped) {
243+
print " [OK]\n";
244+
} else {
245+
$failures++;
246+
print " [FAILED]\n";
247+
}
242248
}
243249
}
244250

0 commit comments

Comments
 (0)