summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHwankyu Jhun <h.jhun@samsung.com>2022-07-14 14:03:10 +0900
committerHwankyu Jhun <h.jhun@samsung.com>2022-07-14 14:03:10 +0900
commit859608002d1180080d70802213c1bce404248906 (patch)
tree9b0c67c42605f35950c79f80090cdf1ab94d01aa
parent74794742827657bbdee292d8258313de2458cb02 (diff)
downloadapplication-859608002d1180080d70802213c1bce404248906.tar.gz
application-859608002d1180080d70802213c1bce404248906.tar.bz2
application-859608002d1180080d70802213c1bce404248906.zip
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: I5c8a7e7273042509b28b6c3c84a9174fba4145a1 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rw-r--r--packaging/capi-appfw-application.spec14
1 files changed, 14 insertions, 0 deletions
diff --git a/packaging/capi-appfw-application.spec b/packaging/capi-appfw-application.spec
index 8c4c47d..ab6a7f0 100644
--- a/packaging/capi-appfw-application.spec
+++ b/packaging/capi-appfw-application.spec
@@ -97,17 +97,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/ui-app-ambient_unittest
}
teardown() {
echo "teardown start"
+ set_perm
}
main() {