geos: add package tests

This commit is contained in:
Ivan Mincik 2022-12-14 12:32:49 +01:00
parent e21717896d
commit b703fb0361
2 changed files with 23 additions and 3 deletions

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";

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
''