enable coverage-suite on gbs build (#1058)
author이춘석/동작제어Lab(SR)/Senior Engineer/삼성전자 <chunseok.lee@samsung.com>
Thu, 3 May 2018 10:35:25 +0000 (19:35 +0900)
committer서상민/동작제어Lab(SR)/Senior Engineer/삼성전자 <sangmin7.seo@samsung.com>
Thu, 3 May 2018 10:35:25 +0000 (19:35 +0900)
1. coverage-suite on gbs build
2. docker_gbs_build.sh accepts gbs define option

Signed-off-by: Chunseok Lee <chunseok.lee@samsung.com>
packaging/nnfw.spec
scripts/command/docker_gbs_build.sh

index 1cc96b3..7b50d3a 100644 (file)
@@ -48,16 +48,24 @@ NNFW test rpm. It does not depends on nnfw rpm since it contains nnfw runtime.
 %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
@@ -69,6 +77,13 @@ cp -rf ./tests %{buildroot}%{test_install_prefix}/.
 ## 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
index 4f9d373..cfada8a 100755 (executable)
@@ -22,7 +22,7 @@ DOCKER_VOLUMES+=" -v ${GBS_RPM_DIR}:${DOCKER_RPM_HOME} -v $NNFW_ROOT:${DOCKER_NN
 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=$?