[python-memcached] Enable running tests in %check

Radek Novacek rnovacek at fedoraproject.org
Thu Nov 1 10:19:50 UTC 2012


commit 767f95ff07bbdc8c37f75a034e4df8c256a3c823
Author: Radek Novacek <rnovacek at redhat.com>
Date:   Thu Nov 1 11:19:45 2012 +0100

    Enable running tests in %check

 python-memcached.spec |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/python-memcached.spec b/python-memcached.spec
index 8e5ecc9..a35360a 100644
--- a/python-memcached.spec
+++ b/python-memcached.spec
@@ -2,7 +2,7 @@
 
 Name:           python-memcached
 Version:        1.48
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        A Python memcached client library
 
 Group:          Development/Languages
@@ -13,6 +13,8 @@ BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildArch:      noarch
 BuildRequires:  python-devel, python-setuptools
+# Required for running test suite
+BuildRequires:  memcached
 
 %description
 This software is a 100% Python interface to the memcached memory cache
@@ -33,6 +35,14 @@ rm -rf $RPM_BUILD_ROOT
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%check
+pushd $RPM_BUILD_ROOT/%{python_sitelib}
+pidfile=$(mktemp)
+/usr/bin/memcached -d -P $pidfile
+%{__python} memcache.py
+kill $(cat $pidfile)
+popd
+
 %files
 %defattr(-,root,root,-)
 %doc ChangeLog README
@@ -41,6 +51,9 @@ rm -rf $RPM_BUILD_ROOT
 %{python_sitelib}/python_memcached-%{version}-py*.egg-info/
 
 %changelog
+* Thu Nov 01 2012 Radek Novacek <rnovacek at redhat.com> 1.48-2
+- Enable running tests in %check
+
 * Wed Oct 31 2012 Radek Novacek <rnovacek at redhat.com> 1.48-1
 - Update to 1.48
 


More information about the scm-commits mailing list