1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-17 19:21:04 +00:00
nixpkgs/nixos/tests/qgis.nix
Ivan Mincik 54444b5892 qgis: add nixos tests
Add NixOS test for QGIS and QGIS-LTR. This test creates QGIS vector
memory layer containing Nix snowflake. This proves that application can
successfully start and Python bindings are working.

By default, Python script is executed in non-interactive mode and QGIS
is closed after script is finished. This script can be also executed
interactively by running following command:

```
 nix-build -A qgis
 QGIS_TEST_INTERACTIVE=True ./result/bin/qgis  --code pkgs/applications/gis/qgis/test.py
```

In this case, QGIS is not automatically closed.
2023-09-02 17:15:56 +02:00

31 lines
750 B
Nix

import ./make-test-python.nix ({ pkgs, lib, qgisPackage, ... }:
let
testScript = pkgs.writeTextFile {
name = "qgis-test.py";
text = (builtins.readFile ../../pkgs/applications/gis/qgis/test.py);
};
in
{
name = "qgis";
meta = {
maintainers = with lib; [ teams.geospatial.members ];
};
nodes = {
machine = { pkgs, ... }: {
virtualisation.diskSize = 2 * 1024;
imports = [ ./common/x11.nix ];
environment.systemPackages = [ qgisPackage ];
};
};
testScript = ''
start_all()
machine.succeed("${qgisPackage}/bin/qgis --version | grep 'QGIS ${qgisPackage.version}'")
machine.succeed("${qgisPackage}/bin/qgis --code ${testScript}")
'';
})