5 SPECPATH=`find . -name *.spec`
7 APP=`cat $SPECPATH | grep Name: | awk '{ print $2 }'`
8 VER1=`cat $SPECPATH | grep "^Version:" | awk '{ print $2 }'`
9 REL=`cat $SPECPATH | grep Release: | awk '{ print $2 }'`
12 VERSHORT=${VER%-*} # 1.2.3
16 if [ -z $RPATH ]; then
17 echo "argument error : 1st arg is path "
18 echo "usage) ./unittest.sh /home/mjpark/GBS-ROOT/local/repos/slp/armv7l/RPMS capi-system-system-settings 0.0.3-3 armv7l"
23 echo "argument error : 3th arg is Version"
24 echo "usage) ./unittest.sh /home/mjpark/GBS-ROOT/local/repos/slp/armv7l/RPMS capi-system-system-settings 0.0.3-3 armv7l"
28 sudo gbs build -A $ARCH --include-all --define "run_tests 1" || exit 1
29 # ex ) ./unittest.sh /home/mjpark/GBS-ROOT/local/repos/slp/armv7l/RPMS capi-system-system-settings 0.0.3-3 armv7l
35 $SDB shell mount -o remount,rw /
36 $SDB push $RPM_ROOT/$APP-$VER.$ARCH.rpm /opt
37 $SDB push $RPM_ROOT/$APP-debuginfo-$VER.$ARCH.rpm /opt
38 $SDB push $RPM_ROOT/$APP-debugsource-$VER.$ARCH.rpm /opt
40 $SDB shell rpm -Uvh --force --nodeps /opt/$APP-$VER.$ARCH.rpm
41 $SDB shell rpm -Uvh --force --nodeps /opt/$APP-debuginfo-$VER.$ARCH.rpm
42 $SDB shell rpm -Uvh --force --nodeps /opt/$APP-debugsource-$VER.$ARCH.rpm
44 echo "UNIT TEST----------------------------------------------------"
45 export GCOV_PREFIX=/opt
46 $SDB shell G_DEBUG=fatal-criticals GCOV_PREFIX=/usr/src/packages GCOV_PREFIX_STRIP=3 /usr/local/bin/system-setting-unittest
48 echo "COVERAGE TEST----------------------------------------------------"
49 sdb pull /usr/src/packages/BUILD/$APP-$VERSHORT/CMakeFiles > /dev/null 2>&1
50 lcov -c -d $APP.dir/ -o $APP.info > /dev/null 2>&1
52 VAR1="/usr/src/packages/BUILD/$APP-$VERSHORT"
54 sed -i "s#$VAR1#$PWD#g" $APP.info
56 genhtml $APP.info -o out
57 find . -name "*.dir" -type d -prune -exec rm -rf '{}' '+'