-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcollect_data.sh
executable file
·59 lines (47 loc) · 1.81 KB
/
collect_data.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh
C_FILES=c_testcases.list
CPP_FILES=cpp_testcases.list
printf "Total number of test cases in Juliet: %s\n" \
`find juliet/testcases -regex '.*[0-9a]\.c[p]*$' | wc -l`
echo
printf "Number of C test cases in Juliet: %s\n" \
`find juliet/testcases -regex '.*[0-9a]\.c$' | wc -l`
echo
printf "Number of C++ test cases in Juliet: %s\n" \
`find juliet/testcases -regex '.*[0-9a]\.cpp$' | wc -l`
echo
printf "Number of CWEs covered in juliet: %s\n" \
`ls juliet/testcases | wc -l`
echo
printf "Number of C test cases used in this experiment: %s\n" \
`cat $C_FILES | grep '.*[0-9a]\.c$' | wc -l`
printf "\tthis excludes windows specific test cases\n"
echo
printf "Number of C++ test cases used in this experiment: %s\n" \
`cat $CPP_FILES | grep '.*[0-9a]\.cpp$' | wc -l`
printf "\tthis excludes windows specific test cases\n"
echo
printf "Number of different Juliet CWEs analyzed in this experiment: %s\n" \
`cat c_testcases.list cpp_testcases.list | cut -d / -f3 | sort -u | wc -l`
printf "\tthis excludes CWEs containing only windows specific test cases\n"
echo
printf "Number of CWEs convered on the C test cases used %s\n" \
`cat c_testcases.list | cut -d / -f3 | sort -u | wc -l`
echo
printf "Number of CWEs convered on the C++ test cases used %s\n" \
`cat cpp_testcases.list | cut -d / -f3 | sort -u | wc -l`
echo
echo 'Version of static analyzers:'
# This is RPM distro specific and could be improved
printf "\tFrama-C: %s\n" \
`rpm -qi frama-c | grep Version | awk '{ print $3 }'`
# flawfinder
printf "\tflawfinder: %s\n" \
`rpm -qi flawfinder | grep Version | awk '{ print $3 }'`
printf "\tcppcheck: %s\n" \
`rpm -qi cppcheck | grep Version | awk '{ print $3 }'`
# scan-build
printf "\tscan-build (Clang Analyzer): %s\n" \
`rpm -qi clang-analyzer | grep Version | awk '{ print $3 }'`
echo
python firehose_report_parser.py stats