Project

General

Profile

Revision 8fdeb449

View differences:

scripts/gen_test_suite.sh
162 162
	
163 163
	# We call kind-inter to rebuild the expected output
164 164
	xsltproc ${inputcsv_xsl} tmp/tmp_${name}_last_input_new.res| grep -v xml | sed "s/ //g" | grep -v "^$" > tmp/input_test
165
	timeout $timeout kind-inter -xml -f tmp/input_test -xml ${file_flat} > tmp/tmp_${name}_last_new.res
165
	timeout $timeout kind-inter -xml -f tmp/input_test  ${file_flat} > tmp/tmp_${name}_last_new.res
166 166
	# cat tmp/${file_flat}.xml
167 167

  
168 168
	new_tests=""
......
217 217
	    $binary < tmp/test_tmp_${name} | sed "s/^.*: '\([^']*\)'/\1/g" | xargs > tmp/result_tmp_${name}
218 218
	    echo $test | xsltproc ${outputxsl} - | grep -v xml | sed "s/true/1/g;s/false/0/g" | xargs > tmp/oracle_tmp_${name}
219 219
	    diff tmp/oracle_tmp_${name} tmp/result_tmp_${name} > /dev/null
220
	    [ $? -eq 1 ] && echo "Failure:" && echo "inputs: $inputs" && echo "outputs: \"`cat tmp/result_tmp_${name}`\"" && echo "expected outputs: \"`cat tmp/oracle_tmp_${name}`\"" && echo $test && exit 1
220
	    res_diff=$?
221
	    [ ${res_diff} -eq 1 ] && echo "Failure: ${inputs}. Result is `cat tmp/result_tmp_${name}`. Expected outputs: `cat tmp/oracle_tmp_${name}`" | tee -a ${summary}_run #&& echo $test && exit 1
222
	    [ ${res_diff} -eq 0 ] && echo "Test ok: ${inputs}. Result is `cat tmp/result_tmp_${name}`" | tee -a ${summary}_run
221 223
	done < "$suitef"
222 224
    done
223 225
}
scripts/stats.sh
1
#!/bin/bash
2

  
3
echo "directory, file, nb mutants, nb tests mcdc, mean length, mcdc?, nb killed mutants, nb mutants new tests, nb mutants equiv, nb new tests, nb mutants inconclusive, tests ok, tests mutants ok"
4

  
5
for i in */*; do
6
#    echo $i
7
    name=`basename $i`
8
    nb_mutants=`ls -l $i/mutants | wc -l`
9
    test_file="$i/tests/${name}.test_suite"
10
    nb_test_mcdc=`cat $test_file | wc -l`
11
    # computing length
12
    rm length
13
    while read l; do 
14
	echo $l | sed "s/\/Value>/\/Value>\n/g" | grep Value | sed "s/^.*step=\"\([0-9]*\).*$/\1/" | sort -u | tail -n 1 >> length;
15
	echo "+" >> length
16
    done < ${test_file}
17
    echo "0" >> length
18
    
19
    toto="(`cat length | xargs`) / ${nb_test_mcdc}"
20
    length=`echo $toto | bc -l | sed "s/\(\.[0-9][0-9]\).*/\1/"`
21
    [ ! -f $i/tests/${name}.test_suite.no_mcdc  ]
22
    if [ $? -eq 0 ]; then mcdc="yes"; else mcdc="no"; fi
23

  
24
    nb_killed_m=`cat $i/summaries/${name}.summary | grep "killed by test" | wc -l`
25
    nb_m_new_tests=`cat $i/summaries/${name}.summary_new | grep "killed" | wc -l`
26
    nb_m_equiv=`cat $i/summaries/${name}.summary_new | grep "Unobservable" | wc -l`
27
    nb_new_tests=`cat $i/tests/${name}.test_suite_new | wc -l`
28
    nb_m_inconclusive=`cat $i/summaries/${name}.summary_new | grep "Inconclusive" | wc -l`
29
#    tests_ok="`cat  $i/summaries/${name}.summary_run | grep -v Failure`/`cat cat  $i/summaries/${name}.summary_run | wc -l`"
30
    tests_ok="tbd"
31
    tests_m_ok="tbd"
32
    
33
    echo `dirname $i`, \
34
	${name}, \
35
	${nb_mutants}, \
36
	${nb_test_mcdc}, \
37
	$length, \
38
	${mcdc}, \
39
	${nb_killed_m}, \
40
	${nb_m_new_tests}, \
41
	${nb_m_equiv}, \
42
	${nb_new_tests}, \
43
	${nb_m_inconclusive}, \
44
	${tests_ok}, \
45
	${tests_m_ok}	
46
    
47
done

Also available in: Unified diff