[packages/trojita] run tests
glen
glen at pld-linux.org
Sat Apr 6 00:19:36 CEST 2013
commit fd514bb2d2dafede1cbc48f1fe1b6aaef41414ff
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Sat Mar 16 23:23:07 2013 +0200
run tests
trojita.spec | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
---
diff --git a/trojita.spec b/trojita.spec
index cb5dad8..4fa64ec 100644
--- a/trojita.spec
+++ b/trojita.spec
@@ -1,5 +1,9 @@
# TODO
# - localizations proper packaging
+#
+# Conditional build:
+%bcond_without tests # build without tests
+
%define qtver 4.3.3-3
Name: trojita
Version: 0.3.92
@@ -25,12 +29,19 @@ BuildRequires: qt4-build >= %{qtver}
BuildRequires: qt4-linguist >= %{qtver}
BuildRequires: qt4-qmake >= %{qtver}
BuildRequires: rpmbuild(macros) >= 1.129
+%if %{with tests}
+BuildRequires: xkeyboard-config
+BuildRequires: xorg-xserver-Xvfb
+%endif
Requires: QtSql-sqlite3 >= %{qtver}
Requires: desktop-file-utils
Requires: gtk-update-icon-cache
Requires: hicolor-icon-theme
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+# display used for testing
+%define X_display ":98"
+
%description
Trojita is a Qt IMAP e-mail client which:
- Enables you to access your mail anytime, anywhere.
@@ -60,6 +71,13 @@ PATH=%{_libdir}/qt4/bin:$PATH \
CXX="%{__cxx}" \
CXXFLAGS="%{rpmcxxflags} "'$(DEFINES)'
+%if %{with tests}
+export DISPLAY=%{X_display}
+Xvfb %{X_display} &
+trap "kill $! || true" EXIT
+%{__make} test
+%endif
+
%install
rm -rf $RPM_BUILD_ROOT
%{__make} install \
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/trojita.git/commitdiff/9ddbcb59d1c7f40b81516b23d0d6a8c354a8c61b
More information about the pld-cvs-commit
mailing list