geos: add package tests

This commit is contained in:
Ivan Mincik
2023-09-18 22:55:10 +02:00
parent e21717896d
commit b703fb0361
2 changed files with 23 additions and 3 deletions
+8 -3
View File
@@ -1,8 +1,10 @@
{ lib
, fetchurl
, fetchpatch
, stdenv
, callPackage
, fetchpatch
, fetchurl
, testers
, cmake
}:
@@ -29,7 +31,10 @@ stdenv.mkDerivation (finalAttrs: {
doCheck = true;
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
passthru.tests = {
pkg-config = testers.hasPkgConfigModules { package = finalAttrs.finalPackage; };
geos = callPackage ./tests.nix { geos = finalAttrs.finalPackage; };
};
meta = with lib; {
description = "C/C++ library for computational geometry with a focus on algorithms used in geographic information systems (GIS) software";
+15
View File
@@ -0,0 +1,15 @@
{ runCommand, geos }:
let
inherit (geos) pname;
in
runCommand "${geos}-tests" { meta.timeout = 60; }
''
${geos}/bin/geosop \
--explode \
--format wkt \
polygonize \
-a "MULTILINESTRING ((200 100, 100 100, 200 200), (200 200, 200 100), (200 200, 300 100, 200 100))" \
| grep 'POLYGON ((200 100, 100 100, 200 200, 200 100))'
touch $out
''