Add "_without_tests" option to gbs build system 03/138003/3
authorPaweł Stawicki <p.stawicki@partner.samsung.com>
Mon, 10 Jul 2017 17:59:11 +0000 (19:59 +0200)
committerPaweł Stawicki <p.stawicki@partner.samsung.com>
Tue, 11 Jul 2017 08:49:45 +0000 (10:49 +0200)
running gbs build without tests:
gbs  build -A armv7l -P public_4.0_mobile-tm1 --include-all --define "jobs 2" --define "_without_tests 1"

Change-Id: I5027275dad269f3383440765bd1d58b4a9be512f

CMakeLists.txt
packaging/org.tizen.universal-switch.spec

index 45f6123..7e5f989 100644 (file)
@@ -7,6 +7,8 @@ PROJECT(universal-switch CXX)
 
 FIND_PACKAGE(PkgConfig REQUIRED)
 
+option(TESTS "enable/disable universal switch tests" ON)
+
 pkg_check_modules(pkgs REQUIRED
     capi-appfw-service-application
     capi-appfw-application
@@ -28,4 +30,6 @@ ADD_DEFINITIONS("-DDEBUG_PRINTING_LEVEL=DEBUG_PRINTING_LEVEL_DEBUG")
 INSTALL(FILES org.tizen.universal-switch.xml DESTINATION ${TZ_SYS_RO_PACKAGES})
 
 ADD_SUBDIRECTORY(src)
-ADD_SUBDIRECTORY(tests)
+if(TESTS)
+ ADD_SUBDIRECTORY(tests)
+endif()
index 48ffbed..c1901dc 100644 (file)
@@ -1,3 +1,5 @@
+%bcond_without tests
+
 Name:       org.tizen.universal-switch
 Summary:    Universal Switch Assistive Technology
 Version:    0.0.1
@@ -21,15 +23,7 @@ BuildRequires:  pkgconfig(capi-ui-efl-util)
 BuildRequires:  net-config
 
 %description
-An utility library for developers of the menu screen.
-
-
-%package tests
-Summary: Universal Switch Assistive Technology - tests
-
-%description tests
-Universal Switch tests
-
+Assistive technology client for users with dexterity disability.
 
 %prep
 %setup -q
@@ -38,10 +32,12 @@ Universal Switch tests
 %define DataDir %{?TZ_SYS_RO_SHARE:%TZ_SYS_RO_SHARE}%{!?TZ_SYS_RO_SHARE:/usr/share}
 %define AppDir %{TZ_SYS_RO_APP}/%{name}
 
-rm -rf CMakeFiles CMakeCache.txt
 
 cmake . -DCMAKE_INSTALL_PREFIX="%{AppDir}" \
        -DTZ_SYS_RO_PACKAGES=%{TZ_SYS_RO_PACKAGES} \
+%if !%{with tests}
+       -DTESTS=OFF
+%endif
 
 make %{?jobs:-j%jobs}
 
@@ -66,9 +62,17 @@ rm -rf %{buildroot}
 %{DataDir}/packages/%{name}.xml
 
 
+%if %{with tests}
+%package tests
+Summary: Universal Switch Assistive Technology - tests
+
+%description tests
+Universal Switch tests
+
 %post tests
 %{AppDir}/tests/VConfImplTests_init.sh
 
 %files tests
 %{AppDir}/tests/*
 %license LICENSE
+%endif