about summary refs log tree commit diff
path: root/pkgs/applications/gis
diff options
context:
space:
mode:
authorIvan Mincik <ivan.mincik@gmail.com>2023-07-02 23:36:36 +0200
committerIvan Mincik <ivan.mincik@gmail.com>2023-07-02 23:36:36 +0200
commit79dffec139fdfc7d086e360762f1815b86eae7c4 (patch)
treea87ecc13c54e21d7766960f894af1a5bf5e49525 /pkgs/applications/gis
parentdbb11d0990bdae1fa6466e91ce345ecf135a8717 (diff)
grass: add package tests
Diffstat (limited to 'pkgs/applications/gis')
-rw-r--r--pkgs/applications/gis/grass/default.nix9
-rw-r--r--pkgs/applications/gis/grass/tests.nix18
2 files changed, 25 insertions, 2 deletions
diff --git a/pkgs/applications/gis/grass/default.nix b/pkgs/applications/gis/grass/default.nix
index a3255658cfb5f..0d16ba036a9c6 100644
--- a/pkgs/applications/gis/grass/default.nix
+++ b/pkgs/applications/gis/grass/default.nix
@@ -1,5 +1,6 @@
 { lib
 , stdenv
+, callPackage
 , fetchFromGitHub
 , makeWrapper
 , wrapGAppsHook
@@ -31,7 +32,7 @@
 , zstd
 }:
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (finalAttrs: rec {
   pname = "grass";
   version = "8.3.0";
 
@@ -140,6 +141,10 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
+  passthru.tests = {
+    grass = callPackage ./tests.nix { grass = finalAttrs.finalPackage; };
+  };
+
   meta = with lib; {
     description = "GIS software suite used for geospatial data management and analysis, image processing, graphics and maps production, spatial modeling, and visualization";
     homepage = "https://grass.osgeo.org/";
@@ -147,4 +152,4 @@ stdenv.mkDerivation rec {
     maintainers = with maintainers; teams.geospatial.members ++ [ mpickering ];
     platforms = platforms.all;
   };
-}
+})
diff --git a/pkgs/applications/gis/grass/tests.nix b/pkgs/applications/gis/grass/tests.nix
new file mode 100644
index 0000000000000..1a38d07de7891
--- /dev/null
+++ b/pkgs/applications/gis/grass/tests.nix
@@ -0,0 +1,18 @@
+{ runCommand, grass }:
+
+let
+  inherit (grass) pname version;
+
+in
+runCommand "${pname}-tests" { meta.timeout = 60; }
+  ''
+    HOME=$(mktemp -d)
+
+    ${grass}/bin/grass --tmp-location EPSG:3857 --exec g.version \
+      | grep 'GRASS ${version}'
+
+    ${grass}/bin/grass --tmp-location EPSG:3857 --exec g.mapset -l \
+      | grep 'PERMANENT'
+
+    touch $out
+  ''