summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2016-03-08 10:24:38 +0200
committerDaniel Zaoui <daniel.zaoui@samsung.com>2016-03-08 10:24:38 +0200
commitf4f01eaadda3f89bfad096de47b7c6059162e007 (patch)
tree1ddc34fbe2233e90049e3f74a6834426c4846885
First commit
-rwxr-xr-xScripts/AutomateExactness.sh69
-rwxr-xr-xScripts/ExactnessStats.sh34
-rwxr-xr-xScripts/ExactnessSteal.sh45
3 files changed, 148 insertions, 0 deletions
diff --git a/Scripts/AutomateExactness.sh b/Scripts/AutomateExactness.sh
new file mode 100755
index 0000000..dfd470a
--- /dev/null
+++ b/Scripts/AutomateExactness.sh
@@ -0,0 +1,69 @@
1#$1: specific test to check
2
3dir=/tmp/Exactness
4
5RED='\033[0;31m'
6GREEN='\033[0;32m'
7NC='\033[0m' # No Color
8
9mkdir -p $dir 2> /dev/null
10cd $dir
11
12echo "#include <Elementary.h>" > main.c
13echo "#include \"demo.h\"" >> main.c
14echo "EAPI_MAIN int elm_main(int argc, char **argv) { project_elm_win_1_create(NULL); elm_run(); return 0; }" >> main.c
15echo "ELM_MAIN()" >> main.c
16
17rm -rf orig current
18
19if [ $# -eq 1 ]
20then
21 only_test=`echo $1 | tr -d "\"" | tr '[:upper:]' '[:lower:]' | tr "-" " " | tr -s " " "_"`
22fi
23
24IFS="
25"
26tests_list=`cat ~/e/exactness-elm-data/default-profile/tests.txt | grep -v "#" | sed -n "s/.*test-win-only \(.*\)/\1/p"`
27for test_name in $tests_list
28do
29 REC_NAME=`echo $test_name | tr -d "\"" | tr '[:upper:]' '[:lower:]' | tr "-" " " | tr -s " " "_"`
30 if [ "$only_test" != "" -a "$only_test" != "$REC_NAME" ]
31 then
32 continue
33 fi
34
35 echo "Test $test_name - begin"
36 TEST_SCRIPT="auto_test1_$REC_NAME"
37
38 echo "$REC_NAME elementary_test --test-win-only $test_name" > $TEST_SCRIPT
39
40 rm -f espion_$REC_NAME.ea espion_out.ea
41 exactness -i -b ~/e/exactness-elm-data/default-profile/recordings -w espion_steal $TEST_SCRIPT 2> /dev/null > /dev/null
42
43 echo "Test $test_name - espion applied"
44
45 cp espion_out.ea espion_$REC_NAME.ea
46
47 ea_cgen --gc -o demo.c espion_$REC_NAME.ea 2> /dev/null > /dev/null
48 ea_cgen --gh -o demo.h espion_$REC_NAME.ea 2> /dev/null > /dev/null
49 #rm espion_out.ea
50
51 IFS=" "
52 gcc -g main.c demo.c -o $REC_NAME `pkg-config --cflags --libs elementary`
53 #rm demo.c demo.h
54
55 TEST_SCRIPT="auto_test2_$REC_NAME"
56 echo "Test $test_name - compare"
57 echo "$REC_NAME ./$REC_NAME" > $TEST_SCRIPT
58 exactness -p -b ~/e/exactness-elm-data/default-profile/recordings $TEST_SCRIPT 2> /dev/null > /dev/null
59 if [ $? -eq 0 ]
60 then
61 echo -e "Test $test_name - ${GREEN}Success${NC}"
62 else
63 echo -e "Test $test_name - ${RED}Failure${NC}"
64 fi
65 #rm $REC_NAME $TEST_SCRIPT
66done
67#rm main.c
68
69cd -
diff --git a/Scripts/ExactnessStats.sh b/Scripts/ExactnessStats.sh
new file mode 100755
index 0000000..b49fc9d
--- /dev/null
+++ b/Scripts/ExactnessStats.sh
@@ -0,0 +1,34 @@
1#$1: specific test to check
2
3RED='\033[0;31m'
4GREEN='\033[0;32m'
5NC='\033[0m' # No Color
6
7rm -f /tmp/espion_stats.eet exactness_tests_stats.eet
8espion_stats_format -i -f eet -o exactness_tests_stats.eet 2> /dev/null
9
10if [ $# -eq 1 ]
11then
12 only_test=`echo $1 | tr -d "\"" | tr '[:upper:]' '[:lower:]' | tr "-" " " | tr -s " " "_"`
13fi
14
15IFS="
16"
17tests_list=`cat ~/e/exactness-elm-data/default-profile/tests.txt | grep -v "#"`
18for test_line in $tests_list
19do
20 REC_NAME=`echo $test_line | sed -n "s/\([^ ]*\) .*/\1/p"`
21 if [ "$only_test" != "" -a "$only_test" != "$REC_NAME" ]
22 then
23 continue
24 fi
25
26 echo "Test $test_name - applying espion stats"
27 TEST_SCRIPT="/tmp/auto_test"
28
29 echo "$test_line" > $TEST_SCRIPT
30
31 exactness -s -b ~/e/exactness-elm-data/default-profile/recordings -w espion_cov $TEST_SCRIPT 2> /dev/null > /dev/null
32 espion_stats_format -f eet -o exactness_tests_stats.eet exactness_tests_stats.eet /tmp/espion_stats.eet
33 rm -f $TEST_SCRIPT /tmp/espion_stats.eet
34done
diff --git a/Scripts/ExactnessSteal.sh b/Scripts/ExactnessSteal.sh
new file mode 100755
index 0000000..3fd8fef
--- /dev/null
+++ b/Scripts/ExactnessSteal.sh
@@ -0,0 +1,45 @@
1#$1: specific test to check
2
3dir=/tmp/Exactness
4
5RED='\033[0;31m'
6GREEN='\033[0;32m'
7NC='\033[0m' # No Color
8
9mkdir -p $dir 2> /dev/null
10cd $dir
11
12if [ $# -eq 1 ]
13then
14 only_test=`echo $1 | tr -d "\"" | tr '[:upper:]' '[:lower:]' | tr "-" " " | tr -s " " "_"`
15fi
16
17IFS="
18"
19tests_list=`cat ~/e/exactness-elm-data/default-profile/tests.txt | grep -v "#"`
20for test_line in $tests_list
21do
22 REC_NAME=`echo $test_line | sed -n "s/\([^ ]*\) .*/\1/p"`
23 if [ "$only_test" != "" -a "$only_test" != "$REC_NAME" ]
24 then
25 continue
26 fi
27
28 echo "Test $test_name - applying espion"
29 TEST_SCRIPT="auto_test"
30
31 echo "$test_line" > $TEST_SCRIPT
32
33 rm -f espion_$REC_NAME.ea espion_out.ea
34 exactness -s -b ~/e/exactness-elm-data/default-profile/recordings -w espion_steal $TEST_SCRIPT 2> /dev/null > /dev/null
35 if [ $? -eq 0 ]
36 then
37 echo -e "Test $REC_NAME - ${GREEN}Success${NC}"
38 else
39 echo -e "Test $REC_NAME - ${RED}Failure${NC}"
40 fi
41 mv espion_out.ea espion_$REC_NAME.ea
42 rm -f $TEST_SCRIPT
43done
44
45cd -