From: Hwankyu Jhun Date: Thu, 14 Jul 2022 05:17:32 +0000 (+0900) Subject: Fix run-unittest.sh script X-Git-Tag: submit/tizen/20220714.070033~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f449f278bde69a7a985bd6b2ad878b72615726f9;p=platform%2Fcore%2Fapi%2Fpreference.git Fix run-unittest.sh script For code coverage measurement, the permission of directories and files should be changed for applications. The script sets the smack label as "System::Run" to files. Change-Id: Iaeb3d47e5965726e25c8b3bf83f2d22705ba4860 Signed-off-by: Hwankyu Jhun --- diff --git a/packaging/capi-appfw-preference.spec b/packaging/capi-appfw-preference.spec index 4d80cd7..1de07e6 100644 --- a/packaging/capi-appfw-preference.spec +++ b/packaging/capi-appfw-preference.spec @@ -75,17 +75,31 @@ find . -name '*.gcno' -exec cp --parents '{}' "$gcno_obj_dir" ';' cat << EOF > run-unittest.sh #!/bin/sh +GCOV_PATH="/tmp/home/abuild/rpmbuild/BUILD" +PAKCAGE="%{name}-%{version}" + +set_perm() { + ## Sets the permission for applications + /usr/bin/find /tmp/home/ -print | /usr/bin/xargs -n1 /usr/bin/chsmack -a "System::Run" &> /dev/null + /usr/bin/find /tmp/home/ -print | /usr/bin/xargs -n1 /usr/bin/chsmack -a "System::Run" -t &> /dev/null + /usr/bin/chmod -R 777 /tmp/home/ +} + setup() { echo "setup start" + /usr/bin/mkdir -p "${GCOV_PATH}/${PACKAGE}" + set_perm } test_main() { echo "test_main start" + export "GCOV_PREFIX=/tmp" /usr/bin/preference-unit-tests } teardown() { echo "teardown start" + set_perm } main() {