mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-27 09:23:01 +00:00
54444b5892
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.
31 lines
750 B
Nix
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}")
|
|
'';
|
|
})
|