build: Make tests optional 59/325559/1
authorSeunghun Lee <shiin.lee@samsung.com>
Thu, 12 Jun 2025 02:12:46 +0000 (11:12 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Thu, 12 Jun 2025 04:06:46 +0000 (13:06 +0900)
The enlightenment can be built without tests by:

gbs build --define "disable_tests 1"

Change-Id: I1a00f98490dd21113e53839da7eec423eb313f68

meson.build
meson_options.txt
packaging/enlightenment.spec

index 62e58f0004c2dc91863c05e8c242b925ae2e16bb..1d2f8f6643eb6058b59e229de4846788972534a7 100644 (file)
@@ -76,7 +76,11 @@ dep_dl = cc.find_library('dl', required: false)
 
 subdir('src')
 subdir('data')
-subdir('tests')
+
+if get_option('tests')
+  subdir('tests')
+endif
+
 subdir('isu')
 
 meson.add_install_script('meson/meson_modules.sh', module_files)
index c52fb2fa42baeaac8a57fc05d23807ae5453bb24..3ca74107526fed2b1c045cdfc22ffe25cddf65d0 100644 (file)
@@ -1 +1,2 @@
 option('function-trace', type: 'boolean', value: false, description: 'enable function trace: (default=false)')
+option('tests', type: 'boolean', value: true, description: 'Compile Enlightenment tests')
index ca55f5d163f19238be76c3e6ddea05f8ef07bb2c..909640a6c5cd0d9e424b8f1a44e0018ce68050c1 100644 (file)
@@ -95,12 +95,14 @@ Requires:       pkgconfig(tizen-extension-server)
 %description devel
 Development files for enlightenment
 
+%if "%{disable_tests}" != "1"
 %package tests
 Summary: enlightenment tests package
 Group: System/Libraries
 
 %description tests
 Tests binary for internal API in enlightenment
+%endif
 
 %package isu
 Summary: ISU package for enlightenment
@@ -122,12 +124,14 @@ export LDFLAGS+=" -pie "
 export CFLAGS+=" -fprofile-arcs -ftest-coverage -DTIZEN_TEST_GCOV "
 export LDFLAGS+=" -lgcov "
 %endif
+
 meson setup \
+    builddir --reconfigure \
     --prefix /usr \
     --libdir %{_libdir} \
     --bindir %{_bindir} \
     -Dfunction-trace=true \
-    builddir --reconfigure
+    %{?disable_tests:-Dtests=false}%{!?disable_tests:-Dtests=true}
 
 %install
 export DESTDIR=%{buildroot}
@@ -138,8 +142,10 @@ ln -sf %{_bindir}/enlightenment_input_key %{buildroot}%{_bindir}/input_keyevent
 mkdir -p %{buildroot}/%{_sysconfdir}/resourced/vip-process.d
 cp %{SOURCE1002} %{buildroot}/%{_sysconfdir}/resourced/vip-process.d/enlightenment.conf
 
+%if "%{disable_tests}" != "1"
 %check
 %{buildroot}%{_bindir}/enlightenment-tests
+%endif
 
 %post
 /usr/bin/chsmack %{_bindir}/input_keyevent* -a "System::Tools"
@@ -169,9 +175,11 @@ cp %{SOURCE1002} %{buildroot}/%{_sysconfdir}/resourced/vip-process.d/enlightenme
 %{_includedir}/enlightenment/*
 %{_libdir}/pkgconfig/*.pc
 
+%if "%{disable_tests}" != "1"
 %files tests
 %defattr(-,root,root,-)
 %attr(550,root,root) %{_bindir}/enlightenment-tests
+%endif
 
 %files isu
 /etc/isu/enlightenment/isu.cfg