From e99faa278e1d73f737af05c40ef89fd0a78a4980 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Mar 21 2016 15:22:17 +0000 Subject: check: enable upstream testsuite TODO: Test also non-superuser tests and non-C locales. Version: 5.0-1 --- diff --git a/PyGreSQL.spec b/PyGreSQL.spec index 5c85348..bf78af4 100644 --- a/PyGreSQL.spec +++ b/PyGreSQL.spec @@ -29,6 +29,9 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: postgresql-devel python2-devel python3-devel +# For testsuite +BuildRequires: postgresql-server + %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} %description @@ -82,10 +85,48 @@ rm -rf $RPM_BUILD_ROOT %{python3_sitearch}/*.egg-info +%check +pgdatadir=datadir +pghost=/tmp +pgport=54321 +pgdb=unittest + +pg_start () +{ + initdb "$pgdatadir" -U $(id -u -n) \ + --auth-local=peer --auth-host=ident + pg_ctl -D "$pgdatadir" -l logfile start -o "-k $pghost -p $pgport" -w +} + +pg_stop () +{ + pg_ctl -D "$pgdatadir" stop +} + +pg_createdb () +{ + createdb -h $pghost -p $pgport "$@" +} + +pg_start +pg_createdb "$pgdb" +trap pg_stop EXIT + +cat > LOCAL_PyGreSQL.py < - 5.0-1 - rebase to 5.0 - provide python2-PyGreSQL and add python3-PyGreSQL +- enable testsuite * Wed Feb 03 2016 Fedora Release Engineering - 4.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild