fix the test

now out of 40 tests, only 1 fails

ok landry@
This commit is contained in:
danj 2016-05-01 20:23:54 +00:00
parent 3d9a78cac9
commit 09c62d03b9
2 changed files with 45 additions and 6 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.4 2016/04/27 17:02:34 danj Exp $
# $OpenBSD: Makefile,v 1.5 2016/05/01 20:23:54 danj Exp $
COMMENT = OSM data to PostgreSQL converter
@ -18,9 +18,9 @@ USE_GMAKE = Yes
WANTLIB += boost_system-mt boost_filesystem-mt bz2 c expat
WANTLIB += geos m pthread pq proj z ${MODLUA_WANTLIB}
MODULES = devel/cmake \
databases/postgresql \
# postgresql needs to be first otherwise tests are done by cmake module
MODULES = databases/postgresql \
devel/cmake \
gcc4 \
lang/python \
lang/lua
@ -32,8 +32,10 @@ LIB_DEPENDS = databases/postgresql \
BUILD_DEPENDS = devel/libtool
TEST_DEPENDS = databases/py-psycopg2 \
geo/postgis
# postgresql,-contrib is needed for hstore extension
TEST_DEPENDS = databases/py-psycopg2 \
geo/postgis \
databases/postgresql,-contrib
MODGCC4_ARCHS = *
MODGCC4_LANGS += c++
@ -45,6 +47,12 @@ MODLUA_SA = Yes
CONFIGURE_ARGS = -DBUILD_TESTS=ON
# bump postgresql,-server limits according to its README otherwise some
# tests fail
MODPOSTGRESQL_TEST_DBNAME = osm2pgsql-test
MODPOSTGRESQL_TEST_CMD = cd ${WRKSRC} && ${MODPY_BIN} tests/regression-test.py \
-x ${WRKBUILD}/osm2pgsql
pre-configure:
${SUBST_CMD} ${WRKSRC}/CMakeLists.txt
rm -f ${WRKSRC}/cmake/FindLua.cmake

View File

@ -0,0 +1,31 @@
$OpenBSD: patch-tests_regression-test_py,v 1.1 2016/05/01 20:23:54 danj Exp $
--- tests/regression-test.py.orig Wed Mar 2 15:06:44 2016
+++ tests/regression-test.py Sun May 1 19:58:24 2016
@@ -490,7 +490,7 @@ def findContribSql(filename):
# Try to get base dir for postgres contrib
try:
- postgis_base_dir = os.popen('pg_config | grep -m 1 "^INCLUDEDIR ="').read().strip().split(' ')[2].split('/include')[0]
+ postgis_base_dir = os.popen('pg_config | grep "^INCLUDEDIR =" |head -n1').read().strip().split(' ')[2].split('/include')[0]
except:
postgis_base_dir = '/usr'
@@ -550,6 +550,9 @@ def setupDB():
global created_tablespace
created_tablespace = 0
+ subprocess.call(["/bin/rm", "-rf", "/tmp/psql-tablespace"])
+ os.makedirs("/tmp/psql-tablespace")
+ test_cur.execute("""CREATE TABLESPACE tablespacetest LOCATION '/tmp/psql-tablespace'""")
test_cur.execute("""SELECT spcname FROM pg_tablespace WHERE spcname = 'tablespacetest'""")
if test_cur.fetchone():
print "We already have a tablespace, can use that"
@@ -609,7 +612,7 @@ def tearDownDB():
gen_cur.close()
gen_conn.close()
if (created_tablespace == 1):
- returncode = subprocess.call(["/usr/bin/sudo", "/bin/rmdir", "/tmp/psql-tablespace"])
+ returncode = subprocess.call(["/bin/rm", "-rf", "/tmp/psql-tablespace"])
if __name__ == "__main__":