From: Dongsun Lee Date: Tue, 10 Dec 2024 07:52:05 +0000 (+0900) Subject: Disable test build by default X-Git-Tag: accepted/tizen/unified/20241211.152216^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=019c0a298269d635f1aa9d90bc27082c58c69d94;p=platform%2Fcore%2Fapi%2Fresource.git Disable test build by default - to build the test package, use test_build_on flag as below. gbs build -A armv7l --define "test_build_on 1" Change-Id: I163b6e96fe7993b2dbdda4a36aa94416ebf45c5f --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 59e3147..f76aee2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,4 +49,6 @@ INSTALL( FILES_MATCHING PATTERN "cpu-boosting*.h") ADD_SUBDIRECTORY(src/plugin) -ADD_SUBDIRECTORY(tests) +IF(TEST_BUILD_ON) + ADD_SUBDIRECTORY(tests) +ENDIF(TEST_BUILD_ON) diff --git a/packaging/capi-system-resource.spec b/packaging/capi-system-resource.spec index 6e420c6..a7bbdd8 100644 --- a/packaging/capi-system-resource.spec +++ b/packaging/capi-system-resource.spec @@ -9,7 +9,8 @@ Source1: capi-system-resource.manifest BuildRequires: cmake BuildRequires: pkgconfig(capi-base-common) BuildRequires: pkgconfig(dlog) -BuildRequires: pkgconfig(glib-2.0) + +%global build_test_package %{?test_build_on:%test_build_on}%{!?test_build_on:0} %description API library for system resource management and optimization @@ -30,12 +31,15 @@ Requires: %{name} = %{version}-%{release} %description plugin API plugin library +%if %{build_test_package} %package test Summary: API test for system resource management and optimization Group: System/Development +BuildRequires: pkgconfig(glib-2.0) Requires: %{name} = %{version}-%{release} %description test +%endif %prep @@ -47,9 +51,13 @@ MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` %cmake . -DMAJORVER=${MAJORVER} \ -DFULLVER=%{version} \ +%if %{build_test_package} + -DTEST_BUILD_ON=ON \ +%endif -DPLUGIN_PATH=%{_libdir} + %__make %{?jobs:-j%jobs} %install @@ -77,6 +85,7 @@ MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` %license LICENSE.MIT %{_libdir}/libcapi-system-resource-plugin.so* +%if %{build_test_package} %files test %manifest %{name}.manifest %license LICENSE.MIT @@ -84,3 +93,4 @@ MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` %{_bindir}/system-resource-test-service %{_unitdir}/system-resource-test-service.service %{_unitdir}/multi-user.target.wants/system-resource-test-service.service +%endif