Add positive and negative test case for CertStoreType class
[platform/core/security/cert-svc.git] / packaging / cert-svc.spec
index f998c38..49d0617 100644 (file)
@@ -1,3 +1,5 @@
+%{!?build_type:%global build_type RELEASE}
+
 Name:    cert-svc
 Summary: Certification service
 Version: 2.2.2
@@ -24,6 +26,11 @@ BuildRequires: ca-certificates
 BuildRequires: ca-certificates-devel
 BuildRequires: ca-certificates-tizen-devel
 BuildRequires: boost-devel
+
+%if "%{build_type}" == "COVERAGE"
+BuildRequires: lcov
+%endif
+
 Requires: ca-certificates
 Requires: ca-certificates-tizen
 Requires: security-config
@@ -36,6 +43,7 @@ Requires: security-config
 %global group_name security_fw
 %global server_stream /tmp/.cert-server.socket
 %global smack_domain_name System
+%global coverage_dir    %{_datadir}/cert-svc-coverage
 
 %global bin_dir                 %{?TZ_SYS_BIN:%TZ_SYS_BIN}%{!?TZ_SYS_BIN:%_bindir}
 %global lib_dir                 %{?TZ_SYS_LIB:%TZ_SYS_LIB}%{!?TZ_SYS_LIB:%_libdir}
@@ -82,6 +90,19 @@ Requires: %{name}-test = %{version}-%{release}
 %description test-binaries
 Certification service (test binaries)
 
+%if "%{build_type}" == "COVERAGE"
+%package coverage
+Summary:    Certification service code coverage data
+Group:      Security/Testing
+Requires:   cert-svc-test = %{version}-%{release}
+Requires:   cert-svc-debugsource = %{version}-%{release}
+Requires:   lcov
+Requires:   gcc
+
+%description coverage
+Certification service code coverage data
+%endif
+
 %prep
 %setup -q
 
@@ -102,7 +123,6 @@ export FFLAGS="$FFLAGS -DTIZEN_EMULATOR_MODE"
 export CFLAGS="$CFLAGS -Wno-stringop-truncation -Wno-stringop-overflow"
 export CXXFLAGS="$CXXFLAGS -Wno-stringop-truncation -Wno-stringop-overflow"
 
-%{!?build_type:%define build_type "Release"}
 %cmake . -DVERSION=%version \
          -DINCLUDEDIR=%_includedir \
          -DUSER_NAME=%user_name \
@@ -124,6 +144,7 @@ export CXXFLAGS="$CXXFLAGS -Wno-stringop-truncation -Wno-stringop-overflow"
          -DCERT_SVC_DB_PATH=%cert_svc_db_path \
          -DCERT_SVC_TESTS=%cert_svc_tests \
          -DCERT_SVC_EXAMPLES=%cert_svc_examples \
+         -DCOVERAGE_DIR=%{coverage_dir} \
          -DCMAKE_BUILD_TYPE=%build_type \
          -DSYSTEMD_UNIT_DIR=%_unitdir
 
@@ -197,3 +218,11 @@ fi
 %files test-binaries
 %manifest %name.manifest
 %cert_svc_tests/apps
+
+%if "%{build_type}" == "COVERAGE"
+%files coverage
+%manifest %{name}.manifest
+%license LICENSE
+%{bin_dir}/cert-svc-coverage.sh
+%coverage_dir
+%endif