Disable test build by default 46/316146/3 accepted/tizen_unified_x_asan accepted/tizen/unified/20241211.152216 accepted/tizen/unified/x/20241218.032732 accepted/tizen/unified/x/asan/20241224.004458
authorDongsun Lee <ds73.lee@samsung.com>
Tue, 10 Dec 2024 07:52:05 +0000 (16:52 +0900)
committerDongsun Lee <ds73.lee@samsung.com>
Wed, 11 Dec 2024 02:02:40 +0000 (11:02 +0900)
- to build the test package, use test_build_on flag as below.
  gbs build -A armv7l --define "test_build_on 1"

Change-Id: I163b6e96fe7993b2dbdda4a36aa94416ebf45c5f

CMakeLists.txt
packaging/capi-system-resource.spec

index 59e314769ead2462005e4b49776024d2f99fba61..f76aee25cb2f30d5f46c0f460796c9e2022f331e 100644 (file)
@@ -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)
index 6e420c66b9c0d5d53a5a23a01ee0bc0499aab5de..a7bbdd8837a6ce369e2533b67bfbd9df3f2a8b3c 100644 (file)
@@ -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