%define target_arch aarch64
%endif
+%{!?coverage_build: %define coverage_build 0}
+%if %{coverage_build} == 1
+%define build_options COVERAGE_BUILD=1 OBS_BUILD=1 BUILD_TYPE=Debug TARGET_ARCH=%{target_arch} TARGET_OS=tizen
+%else
+%define build_options OBS_BUILD=1 BUILD_TYPE=%{build_type} INSTALL_PATH=%{buildroot}%{install_prefix} TARGET_ARCH=%{target_arch} TARGET_OS=tizen
+%endif
+
%prep
%setup -q
cp %{SOURCE1} .
%build
-OBS_BUILD=1 BUILD_TYPE=%{build_type} INSTALL_PATH=%{buildroot}%{install_prefix} TARGET_ARCH=%{target_arch} TARGET_OS=tizen make %{?jobs:-j%jobs}
+%{build_options} make %{?jobs:-j%jobs}
%install
-OBS_BUILD=1 BUILD_TYPE=%{build_type} INSTALL_PATH=%{buildroot}%{install_prefix} TARGET_ARCH=%{target_arch} TARGET_OS=tizen make install
+%{build_options} make install
+%if %{coverage_build} == 0
# nnfw-test rpm(like test-suite on cross build)
## install Product
mkdir -p %{buildroot}%{test_install_prefix}/Product/out
## install tools
mkdir -p %{buildroot}%{test_install_prefix}/tools
cp -rf ./tools/test_driver %{buildroot}%{test_install_prefix}/tools
+%else
+%{build_options} make build_coverage_suite
+mkdir -p %{buildroot}%{test_install_prefix}
+cp -rf Product/out/coverage-suite.tar.gz %{buildroot}%{test_install_prefix}/.
+tar -zxf %{buildroot}%{test_install_prefix}/coverage-suite.tar.gz -C %{buildroot}%{test_install_prefix}
+rm -rf %{buildroot}%{test_install_prefix}/coverage-suite.tar.gz
+%endif
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
DOCKER_RUN_OPTS+=" --rm"
DOCKER_RUN_OPTS+=" -w ${DOCKER_NNFW_HOME}"
-CMD="gbs -c ${DOCKER_NNFW_HOME}/scripts/command/gbs.conf build -A armv7l --profile=profile.tizen --clean --include-all &&
+CMD="gbs -c ${DOCKER_NNFW_HOME}/scripts/command/gbs.conf build -A armv7l --profile=profile.tizen --clean --include-all --define '${GBS_DEFINE}' &&
cp -rf /home/GBS-ROOT/local/repos/tizen/armv7l/RPMS/*.rpm ${DOCKER_RPM_HOME}/."
docker run $DOCKER_RUN_OPTS $DOCKER_VOLUMES ${DOCKER_ENV_VARS:-} ${DOCKER_IMAGE} sh -c "$CMD"
BUILD_RESULT=$?