Changeset: 650f413e080f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/650f413e080f
Modified Files:
geom/sql/conformance/Tests/All
geom/sql/conformance/Tests/T49.test
geom/sql/functions/Tests/All
sql/test/pg_regress/Tests/All
sql/test/pg_regress/Tests/polygon.test
testing/Mtest.py.in
testing/Mz.py.in
Branch: Jul2021
Log Message:
Implemented version check for geos library in testing.
diffs (191 lines):
diff --git a/geom/sql/conformance/Tests/All b/geom/sql/conformance/Tests/All
--- a/geom/sql/conformance/Tests/All
+++ b/geom/sql/conformance/Tests/All
@@ -46,8 +46,8 @@ HAVE_GEOM?T44
HAVE_GEOM?T45
HAVE_GEOM?T46
HAVE_GEOM?T47
-HAVE_GEOM?T48
-#HAVE_GEOM?T49 # disabled because depends on geos library version
+HAVE_GEOM&GEOS_VERSION>=3.9?T48
+HAVE_GEOM&GEOS_VERSION>=3.9?T49
HAVE_GEOM?T50
HAVE_GEOM?T51
HAVE_GEOM?T52
diff --git a/geom/sql/conformance/Tests/T49.test
b/geom/sql/conformance/Tests/T49.test
--- a/geom/sql/conformance/Tests/T49.test
+++ b/geom/sql/conformance/Tests/T49.test
@@ -1,5 +1,5 @@
query T rowsort
SELECT ST_AsText(ST_Union(shore, boundary)) FROM lakes, named_places WHERE
lakes.name = 'Blue Lake' AND named_places.name = 'Goose Island'
----
-POLYGON ((52 18, 66 23, 73 9, 48 6, 52 18))
+POLYGON ((66 23, 73 9, 48 6, 52 18, 66 23))
diff --git a/geom/sql/functions/Tests/All b/geom/sql/functions/Tests/All
--- a/geom/sql/functions/Tests/All
+++ b/geom/sql/functions/Tests/All
@@ -20,7 +20,7 @@ HAVE_GEOM?ST_AsText
HAVE_GEOM?ST_IsClosed
HAVE_GEOM?ST_IsEmpty
-HAVE_GEOM?ST_IsSimple
+HAVE_GEOM&GEOS_VERSION>=3.8?ST_IsSimple
HAVE_GEOM?ST_IsValid
HAVE_GEOM?ST_IsRing
diff --git a/sql/test/pg_regress/Tests/All b/sql/test/pg_regress/Tests/All
--- a/sql/test/pg_regress/Tests/All
+++ b/sql/test/pg_regress/Tests/All
@@ -29,7 +29,7 @@ HAVE_GEOM?point
#HAVE_GEOM?lseg # lseg is NOT supported in MonetDB. lseg (Line Segment) is
also not part of OpenGIS standard so exclude this test
HAVE_GEOM?box # box is not supported in MonetDB but it can be replaced
with mbr (= minimum bounded rectangle)
HAVE_GEOM?path # path is not supported in MonetDB but it can be replaced
with linestring
-HAVE_GEOM?polygon
+HAVE_GEOM&GEOS_VERSION>=3.10?polygon
#HAVE_GEOM?circle # circle is NOT supported in MonetDB. It is also not part of
OpenGIS standard so exclude this test
#HAVE_GEOM?geometry # tables CIRCLE_TBL and LSEG_TBL do not exist as they
have been disabled above. All queries fail
date
diff --git a/sql/test/pg_regress/Tests/polygon.test
b/sql/test/pg_regress/Tests/polygon.test
--- a/sql/test/pg_regress/Tests/polygon.test
+++ b/sql/test/pg_regress/Tests/polygon.test
@@ -15,7 +15,7 @@ POLYGON ((3 1, 3 3, 1 0, 3 1))
statement error
INSERT INTO POLYGON_TBL(f1) VALUES ('POLYGON((0.0 0.0, 0.0 0.0))')
-statement error
+statement ok
INSERT INTO POLYGON_TBL(f1) VALUES ('POLYGON((0.0 1.0, 1.0 1.0, 0.0 1.0))')
statement ok
@@ -57,6 +57,8 @@ SELECT '' AS four, POLYGON_TBL.* FROM PO
(empty)
POLYGON ((0 1, 0 1, 0 1, 0 1))
(empty)
+POLYGON ((0 1, 1 1, 0 1))
+(empty)
POLYGON ((0 2, 0 1, 0 1, 0 1, 0 2))
(empty)
POLYGON ((2 0, 2 4, 0 0, 2 0))
@@ -71,6 +73,8 @@ SELECT * FROM POLYGON_TBL_VW
----
POLYGON ((0 1, 0 1, 0 1, 0 1))
POLYGON ((0 1, 0 1, 0 1, 0 1))
+POLYGON ((0 1, 1 1, 0 1))
+POLYGON ((0 1, 1 1, 0 1))
POLYGON ((0 2, 0 1, 0 1, 0 1, 0 2))
POLYGON ((0 2, 0 1, 0 1, 0 1, 0 2))
POLYGON ((2 0, 2 4, 0 0, 2 0))
@@ -84,6 +88,9 @@ SELECT '' AS three, p.*
WHERE p.f1 && 'POLYGON((3.0 1.0, 3.0 3.0, 1.0 0.0, 3.0 1.0))'
----
(empty)
+POLYGON ((0 1, 1 1, 0 1))
+POLYGON ((0 1, 1 1, 0 1))
+(empty)
POLYGON ((2 0, 2 4, 0 0, 2 0))
POLYGON ((2 0, 2 4, 0 0, 2 0))
(empty)
@@ -108,6 +115,9 @@ SELECT '' AS four, p.*
POLYGON ((0 1, 0 1, 0 1, 0 1))
POLYGON ((0 1, 0 1, 0 1, 0 1))
(empty)
+POLYGON ((0 1, 1 1, 0 1))
+POLYGON ((0 1, 1 1, 0 1))
+(empty)
POLYGON ((0 2, 0 1, 0 1, 0 1, 0 2))
POLYGON ((0 2, 0 1, 0 1, 0 1, 0 2))
(empty)
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -59,6 +59,8 @@ isatty = os.isatty(sys.stdout.fileno())
mapiportre = re.compile(r'mapi:monetdb://[-.a-zA-Z0-9]+:(?P<port>\d+)/')
+geos_version = '@GEOS_VERSION@'
+
# default is no color (these three functions may get redefined)
def prred(str, write = sys.stdout.write):
write(str)
@@ -2026,6 +2028,35 @@ def RunTest(env, TST, COND, oktests, len
elem = SkipTest(env, TST, EXT, reason, length)
break
passwd = cond[7:]
+ elif cond.startswith('GEOS_VERSION>='):
+ if not geos_version:
+ reason = "no geos version information available"
+ elem = SkipTest(env, TST, EXT, reason, length)
+ break
+ req_vers = cond[14:].split('.')
+ act_vers = geos_version.split('.')
+ if not negate:
+ for i in range(len(act_vers)):
+ if i >= len(req_vers):
+ break
+ if int(act_vers[i]) > int(req_vers[i]):
+ break
+ if int(act_vers[i]) < int(req_vers[i]):
+ reason = "geos version too low"
+ elem = SkipTest(env, TST, EXT, reason, length)
+ break
+ else:
+ for i in range(len(act_vers)):
+ if i >= len(req_vers):
+ break
+ if int(act_vers[i]) < int(req_vers[i]):
+ break
+ if int(act_vers[i]) > int(req_vers[i]):
+ reason = "geos version too high"
+ elem = SkipTest(env, TST, EXT, reason, length)
+ break
+ if reason is not None:
+ break
elif cond not in CONDITIONALS:
reason = "as conditional '%s' is unknown." % cond
elem = SkipTest(env, TST, EXT, reason, length)
diff --git a/testing/Mz.py.in b/testing/Mz.py.in
--- a/testing/Mz.py.in
+++ b/testing/Mz.py.in
@@ -57,6 +57,8 @@ isatty = os.isatty(sys.stdout.fileno())
mapiportre = re.compile(r'mapi:monetdb://[-.a-zA-Z0-9]+:(?P<port>\d+)/')
+geos_version = '@GEOS_VERSION@'
+
# default is no color (these three functions may get redefined)
def prred(str, write = sys.stdout.write):
write(str)
@@ -1106,6 +1108,32 @@ def RunTest(env, test, oktests, pSrvr):
reason = "impossible combination of PASSWD= and negation"
break
passwd = cond[7:]
+ elif cond.startswith('GEOS_VERSION>='):
+ if not geos_version:
+ reason = "no geos version information available"
+ break
+ req_vers = cond[14:].split('.')
+ act_vers = geos_version.split('.')
+ if not negate:
+ for i in range(len(act_vers)):
+ if i >= len(req_vers):
+ break
+ if int(act_vers[i]) > int(req_vers[i]):
+ break
+ if int(act_vers[i]) < int(req_vers[i]):
+ reason = "geos version too low"
+ break
+ else:
+ for i in range(len(act_vers)):
+ if i >= len(req_vers):
+ break
+ if int(act_vers[i]) < int(req_vers[i]):
+ break
+ if int(act_vers[i]) > int(req_vers[i]):
+ reason = "geos version too high"
+ break
+ if reason is not None:
+ break
elif cond not in CONDITIONALS:
reason = "as conditional '%s' is unknown." % cond
break
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]