From b703fb03614010cd1feb529cb1acd80045bacd48 Mon Sep 17 00:00:00 2001 From: Ivan Mincik Date: Wed, 14 Dec 2022 12:32:49 +0100 Subject: [PATCH] geos: add package tests --- pkgs/development/libraries/geos/default.nix | 11 ++++++++--- pkgs/development/libraries/geos/tests.nix | 15 +++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 pkgs/development/libraries/geos/tests.nix diff --git a/pkgs/development/libraries/geos/default.nix b/pkgs/development/libraries/geos/default.nix index 5c2369cf4410..1f3ce471dc0e 100644 --- a/pkgs/development/libraries/geos/default.nix +++ b/pkgs/development/libraries/geos/default.nix @@ -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"; diff --git a/pkgs/development/libraries/geos/tests.nix b/pkgs/development/libraries/geos/tests.nix new file mode 100644 index 000000000000..0f11885ab78c --- /dev/null +++ b/pkgs/development/libraries/geos/tests.nix @@ -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 + ''