From 3480ed2bcbed3ddd586cd0f3876e04b82b819a00 Mon Sep 17 00:00:00 2001 From: Piotr Sieduszewski Date: Thu, 27 Nov 2014 12:26:36 +0100 Subject: [PATCH] Script to run all internal EWK unit tests This script: - build EFL and EWK test - prepare mobile device - install EFL and EWK test - run all test by one (restart device at 50 tests) Results is put to test_log/log.htm (It redirect to file with name of last commit title (first line)) This html file have a tests results, and links to html files with history of results for selected the test. Bug: http://107.108.218.239/bugzilla/show_bug.cgi?id=9483 Change-Id: Iace9a61cc9e79d4e31e97d490c3c3403ade1b528 Signed-off-by: Piotr Sieduszewski --- tizen_src/.gitignore | 1 + tizen_src/build/build_mobile.sh | 1 + tizen_src/ewk/tests_run | 68 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100755 tizen_src/ewk/tests_run diff --git a/tizen_src/.gitignore b/tizen_src/.gitignore index 0e1eba9..41cf58d 100644 --- a/tizen_src/.gitignore +++ b/tizen_src/.gitignore @@ -6,3 +6,4 @@ /packaging/*.tar.gz /build/TARGET /src/ +/ewk/test_log diff --git a/tizen_src/build/build_mobile.sh b/tizen_src/build/build_mobile.sh index 207f65c..5d4807a 100755 --- a/tizen_src/build/build_mobile.sh +++ b/tizen_src/build/build_mobile.sh @@ -1,5 +1,6 @@ #!/bin/bash +export ICECC=no SCRIPTDIR=$(cd $(dirname $0); pwd -P) # source common functions and vars diff --git a/tizen_src/ewk/tests_run b/tizen_src/ewk/tests_run new file mode 100755 index 0000000..0fdd1cb --- /dev/null +++ b/tizen_src/ewk/tests_run @@ -0,0 +1,68 @@ +#!/bin/bash -x + +ewk_dir=`cd \`dirname $0\` && pwd`/ +efl_dir=$ewk_dir../ +rep_dir=~/GBS-ROOT-2.3-DEV/local/repos/tizenmb_v2.3/armv7l/RPMS/ +title=`cd ${efl_dir} && git log -n 1 --format=%s` +dir=${ewk_dir}test_log/ +log=`echo $title | sed 's/[\/! #\"<>|:]/_/g'` + +cd $efl_dir && build/build_mobile.sh --include-all --incremental --define "build_ewk_unittest 1" --define "build_ewk_unittests 1" --define 'nodebug 1' --clean-repo || exit 1 +#cd $rep_dir && wget http://10.251.52.177/tizenrepo/tizen_dev_daily_build/m40_2202_0_141120_1/mobile/chromium-efl-40.2202.0.44-1.armv7l.rpm --no-clobber + +timeout 5 sdb root on && sdb shell change-booting-mode.sh --update || exit 2 +sdb shell ulimit -c 1000000 +sdb shell 'rpm -qa | grep chromium-e | while read pakiet ; do rpm -e \$pakiet --nodeps ; done ' + +sdb push ${ewk_dir}thirdparty/nss3.15/* /usr/lib/ ; sdb push ${ewk_dir}thirdparty/nss3.15/* /lib/ +sdb push ${ewk_dir}thirdparty/eglibc-2.18-rpm/eglibc-2.18-5.1.armv7l.rpm /opt/usr/media/Downloads/ && sdb shell rpm -i /opt/usr/media/Downloads/eglibc-2.18-5.1.armv7l.rpm --nodeps --force +#cd ~/Pobrane && wget http://10.251.52.177/tizenrepo/jpn-dcm/Redwood8974JPNDCM_20131218.006/repos/slp-release/armv7l/packages/armv7l/gconf-dbus-2.16.0-1.4.redwood8974om.armv7l.rpm --no-clobber +sdb push ~/Pobrane/gconf-dbus-2.16.0-1.4.redwood8974om.armv7l.rpm /opt/usr/media/Downloads/ && sdb shell rpm -i /opt/usr/media/Downloads/gconf-dbus-2.16.0-1.4.redwood8974om.armv7l.rpm +sdb push ~/Pobrane/gtest-1.3.0.0-3.1.redwood8974om.armv7l.rpm /opt/usr/media/Downloads/ && sdb shell rpm -i /opt/usr/media/Downloads/gtest-1.3.0.0-3.1.redwood8974om.armv7l.rpm + +sdb shell mkdir -p /opt/usr/eglibc-2.18/lib/ +sdb shell cp /lib/ld-linux.so.3 /opt/usr/eglibc-2.18/lib/ + +for rpm in ${rep_dir}*efl-40*.rpm ; do + sdb push $rpm /opt/usr/media/Downloads/ && sdb shell rpm -i /opt/usr/media/Downloads/`basename ${rpm}` --nodeps || exit 3 +done + +for rpm in ${rep_dir}*ewktest*.rpm ; do + sdb push $rpm /opt/usr/media/Downloads/ && sdb shell rpm -i /opt/usr/media/Downloads/`basename ${rpm}` --nodeps || exit 4 +done +sdb shell chmod a+x /opt/usr/utc_exec/ewk_unittest* + +mkdir -p ${dir} +mkdir -p ${dir}${log}/ + +echo "${title}
" > ${dir}${log}.htm +ln -f -s ${dir}${log}.htm ${dir}log.htm + +function log { + if [ ! -e ${dir}${2}.htm ]; then echo '$2
' > ${dir}${2}.htm ; fi + if [ $1 -gt 0 ] + then + sed -i "s//\nFAIL<\/a>\t$3\t${title}<\/a>
/" ${dir}${2}.htm + sed -i "s//\n
FAIL<\/a>\t$3\t${2}<\/a>
/" ${dir}${log}.htm + else + sed -i "s//\n
PASS<\/a>\t$3\t${title}<\/a>
/" ${dir}${2}.htm + sed -i "s/<\/body>/
PASS<\/a>\t$3\t${2}<\/a>
\n<\/body>/" ${dir}${log}.htm + fi +} + +#restart at 50 tests +count=1 +grep -o -e "'utc_blink_\w*.cpp'" ${ewk_dir}unittest/ewk-tests.gypi | grep -o -E '\w{4,}' | sed 's/_func$//g' | while read test ; do + count=$[1+$count] + if [ $count -gt 50 ]; then + timeout 70 sdb shell reboot + while ! sdb root on ; do sdb kill-server ; sleep 70 ; done + sdb shell change-booting-mode.sh --update + count=1 ; + fi + timeout 65 sdb shell "df -k /opt/usr ; /opt/usr/utc_exec/ewk_unittests --gtest_filter=${test}.* ; echo exit:\$?; exit " > ${dir}${log}/${test}.log + grep '\[ PASSED \]' ${dir}${log}/${test}.log | grep -v '0 test' && ! grep '\[ FAILED \]' ${dir}${log}/${test}.log + log $? ${test} UT +done + +exit 0 -- 2.7.4