find . -name '*_proxy.c.gcno' -exec rm {} \;
find . -name '*_stub.c.gcno' -exec rm {} \;
-find . -name '*.gcno' | tar cf %{name}-gcov.tar -T -
-install -d -m 755 %{buildroot}%{_datadir}/gcov/obj
-tar xf %{name}-gcov.tar -C %{buildroot}%{_datadir}/gcov/obj
+builddir=$(basename $PWD)
+gcno_obj_dir=%{buildroot}%{_datadir}/gcov/obj/%{name}/"$builddir"
+mkdir -p "$gcno_obj_dir"
+find . -name '*.gcno' -exec cp --parents '{}' "$gcno_obj_dir" ';'
%endif
+cat << EOF > run-unittest.sh
+#!/bin/sh
+setup() {
+ echo "setup start"
+}
+
+test_main() {
+ echo "test_main start"
+ /usr/bin/nlp-unittests
+}
+
+teardown() {
+ echo "teardown start"
+}
+
+main() {
+ setup
+ test_main
+ teardown
+}
+
+main "\$*"
+EOF
+
+mkdir -p %{buildroot}%{_bindir}/tizen-unittests/%{name}
+install -m 0755 run-unittest.sh %{buildroot}%{_bindir}/tizen-unittests/%{name}
+
%define tizen_sign 1
%define tizen_sign_base %{TZ_SYS_RO_APP}/%{name}
%define tizen_sign_level public