Change rpm name testsuite to unittests
authorKwanghoon Son <k.son@samsung.com>
Tue, 22 Nov 2022 01:37:18 +0000 (20:37 -0500)
committerKwanghoon Son <k.son@samsung.com>
Wed, 14 Dec 2022 06:33:18 +0000 (15:33 +0900)
[Issue type] New
[Version] 0.26.0

For auto linecoverage, this require explicit package name and script to
run.

Change-Id: I2610021585e4ae1f337cb7f810be31a00dcc24c2
Signed-off-by: Kwanghoon Son <k.son@samsung.com>
packaging/capi-media-vision.spec

index 809df54..15a0eb4 100644 (file)
@@ -1,6 +1,6 @@
 Name:        capi-media-vision
 Summary:     Media Vision library for Tizen Native API
-Version:     0.25.4
+Version:     0.26.0
 Release:     0
 Group:       Multimedia/Framework
 License:     Apache-2.0 and BSD-3-Clause
@@ -239,7 +239,7 @@ Media Vision roi_tracker library for Tizen Native API (DEV).
 
 
 %if !0%{?ml_only:1}
-%package testsuite
+%package unittests
 Summary:    Multimedia Vision Test Suite
 Group:      Multimedia/Framework
 Requires:   %{name}-barcode
@@ -251,7 +251,7 @@ Requires:   %{name}-3d
 Requires:   %{name}-roi_tracker
 Requires:   check
 
-%description testsuite
+%description unittests
 Media Vision Test Suite.
 %endif
 
@@ -292,6 +292,34 @@ export LDFLAGS+=" -lgcov"
 make %{?jobs:-j%jobs}
 
 %install
+
+cat << EOF > run-unittest.sh
+#!/bin/bash
+setup() {
+    echo "setup start"
+}
+
+test_main() {
+    echo "test_main start"
+    /usr/bin/mv_test
+}
+
+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}
+
 %make_install
 
 %if 0%{?gcov:1}
@@ -404,7 +432,7 @@ find . -name '*.gcno' -exec cp --parents '{}' "$gcno_obj_dir" ';'
 
 
 %if !0%{?ml_only:1}
-%files testsuite
+%files unittests
 %manifest %{name}.manifest
 %license LICENSE.APLv2
 %{_libdir}/libmv_*helper.so
@@ -418,6 +446,7 @@ find . -name '*.gcno' -exec cp --parents '{}' "$gcno_obj_dir" ';'
 %{_bindir}/test_face_recognition
 %{_bindir}/measure_face_recognition
 %endif
+%{_bindir}/tizen-unittests/%{name}/run-unittest.sh
 %endif
 
 %if 0%{?gcov:1}