lol

glib-networking: add installed tests

+67
+1
nixos/tests/all-tests.nix
··· 94 94 gitlab = handleTest ./gitlab.nix {}; 95 95 gitolite = handleTest ./gitolite.nix {}; 96 96 gjs = handleTest ./gjs.nix {}; 97 + glib-networking = handleTest ./glib-networking.nix {}; 97 98 glusterfs = handleTest ./glusterfs.nix {}; 98 99 gnome3-xorg = handleTest ./gnome3-xorg.nix {}; 99 100 gnome3 = handleTest ./gnome3.nix {};
+17
nixos/tests/glib-networking.nix
··· 1 + # run installed tests 2 + import ./make-test.nix ({ pkgs, ... }: 3 + 4 + { 5 + name = "glib-networking"; 6 + meta = { 7 + maintainers = pkgs.glib-networking.meta.maintainers; 8 + }; 9 + 10 + machine = { pkgs, ... }: { 11 + environment.systemPackages = with pkgs; [ gnome-desktop-testing ]; 12 + }; 13 + 14 + testScript = '' 15 + $machine->succeed("gnome-desktop-testing-runner -d '${pkgs.glib-networking.installedTests}/share'"); 16 + ''; 17 + })
+24
pkgs/development/libraries/glib-networking/default.nix
··· 3 3 , substituteAll 4 4 , meson 5 5 , ninja 6 + , nixosTests 6 7 , pkgconfig 7 8 , glib 8 9 , gettext 10 + , makeWrapper 9 11 , python3 10 12 , gnutls 11 13 , p11-kit ··· 18 20 pname = "glib-networking"; 19 21 version = "2.60.3"; 20 22 23 + outputs = [ "out" "installedTests" ]; 24 + 21 25 src = fetchurl { 22 26 url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; 23 27 sha256 = "1mfw44qpmwvz6yzj8c6spx6z357wrmkk15byrkc5byagd82860fm"; ··· 28 32 src = ./hardcode-gsettings.patch; 29 33 gds_gsettings_path = glib.getSchemaPath gsettings-desktop-schemas; 30 34 }) 35 + 36 + ./installed-tests-path.patch 31 37 ]; 32 38 33 39 postPatch = '' ··· 40 46 ninja 41 47 pkgconfig 42 48 gettext 49 + makeWrapper 43 50 python3 # for install_script 44 51 ]; 45 52 ··· 53 60 54 61 doCheck = false; # tests need to access the certificates (among other things) 55 62 63 + mesonFlags = [ 64 + "-Dinstalled_tests=true" 65 + "-Dinstalled_test_prefix=${placeholder "installedTests"}" 66 + ]; 67 + 68 + postFixup = '' 69 + find "$installedTests/libexec" "$out/libexec" -type f -executable -print0 \ 70 + | while IFS= read -r -d "" file; do 71 + echo "Wrapping program '$file'" 72 + wrapProgram "$file" --prefix GIO_EXTRA_MODULES : "$out/lib/gio/modules" 73 + done 74 + ''; 75 + 56 76 passthru = { 57 77 updateScript = gnome3.updateScript { 58 78 packageName = pname; 79 + }; 80 + 81 + tests = { 82 + installedTests = nixosTests.glib-networking; 59 83 }; 60 84 }; 61 85
+25
pkgs/development/libraries/glib-networking/installed-tests-path.patch
··· 1 + diff --git a/meson.build b/meson.build 2 + index 4d91677..aaaeb2b 100644 3 + --- a/meson.build 4 + +++ b/meson.build 5 + @@ -12,8 +12,8 @@ 6 + libexecdir = join_paths(prefix, get_option('libexecdir')) 7 + localedir = join_paths(prefix, get_option('localedir')) 8 + 9 + -installed_tests_metadir = join_paths(datadir, 'installed-tests', meson.project_name()) 10 + -installed_tests_execdir = join_paths(libexecdir, 'installed-tests', meson.project_name()) 11 + +installed_tests_metadir = join_paths(get_option('installed_test_prefix'), 'share', 'installed-tests', meson.project_name()) 12 + +installed_tests_execdir = join_paths(get_option('installed_test_prefix'), 'libexec', 'installed-tests', meson.project_name()) 13 + 14 + cc = meson.get_compiler('c') 15 + host_system = host_machine.system() 16 + diff --git a/meson_options.txt b/meson_options.txt 17 + index 3a525dd..fc86302 100644 18 + --- a/meson_options.txt 19 + +++ b/meson_options.txt 20 + @@ -3,4 +3,5 @@ 21 + option('libproxy', type: 'feature', value: 'auto', description: 'support for libproxy proxy configration') 22 + option('gnome_proxy', type: 'feature', value: 'auto', description: 'support for GNOME desktop proxy configuration') 23 + option('installed_tests', type: 'boolean', value: false, description: 'enable installed tests') 24 + +option('installed_test_prefix', type: 'string', value: '', description: 'Prefix for installed tests') 25 + option('static_modules', type: 'boolean', value: false, description: 'build static modules')