Unverified Commit ca5179dc authored by Nikolay Korotkiy's avatar Nikolay Korotkiy Committed by GitHub
Browse files

Merge pull request #206059 from imincik/geos-package-tests

geos: add package tests
parents e7ba2fba b703fb03
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
{ 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 −0
Original line number Diff line number Diff line
{ 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
  ''