summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/pgspecial/pgspecial-1.13.0.ebuild')
-rw-r--r--dev-python/pgspecial/pgspecial-1.13.0.ebuild18
1 files changed, 18 insertions, 0 deletions
diff --git a/dev-python/pgspecial/pgspecial-1.13.0.ebuild b/dev-python/pgspecial/pgspecial-1.13.0.ebuild
index f83f61db75dc..9bf3d23fbd6f 100644
--- a/dev-python/pgspecial/pgspecial-1.13.0.ebuild
+++ b/dev-python/pgspecial/pgspecial-1.13.0.ebuild
@@ -20,6 +20,24 @@ RDEPEND="
>=dev-python/psycopg-2.7.4[${PYTHON_USEDEP}]
>=dev-python/sqlparse-0.1.19[${PYTHON_USEDEP}]
"
+BDEPEND="
+ test? ( >=dev-db/postgresql-8.1[server] )"
distutils_enable_tests pytest
DOCS=( License.txt README.rst changelog.rst )
+
+src_test() {
+ local db=${T}/pgsql
+
+ initdb --username=postgres -D "${db}" || die
+ # TODO: random port
+ pg_ctl -w -D "${db}" start \
+ -o "-h '127.0.0.1' -p 5432 -k '${T}'" || die
+ psql -h "${T}" -U postgres -d postgres \
+ -c "ALTER ROLE postgres WITH PASSWORD 'postgres';" || die
+ createdb -h "${T}" -U postgres _test_db || die
+
+ distutils-r1_src_test
+
+ pg_ctl -w -D "${db}" stop || die
+}