glib-networking: add installed tests

This commit is contained in:
Jan Tojnar 2019-09-02 19:06:54 +02:00
parent ce4036177b
commit ecf6f4aeb1
No known key found for this signature in database
GPG Key ID: 7FAB2A15F7A607A4
4 changed files with 67 additions and 0 deletions

View File

@ -94,6 +94,7 @@ in
gitlab = handleTest ./gitlab.nix {}; gitlab = handleTest ./gitlab.nix {};
gitolite = handleTest ./gitolite.nix {}; gitolite = handleTest ./gitolite.nix {};
gjs = handleTest ./gjs.nix {}; gjs = handleTest ./gjs.nix {};
glib-networking = handleTest ./glib-networking.nix {};
glusterfs = handleTest ./glusterfs.nix {}; glusterfs = handleTest ./glusterfs.nix {};
gnome3-xorg = handleTest ./gnome3-xorg.nix {}; gnome3-xorg = handleTest ./gnome3-xorg.nix {};
gnome3 = handleTest ./gnome3.nix {}; gnome3 = handleTest ./gnome3.nix {};

View File

@ -0,0 +1,17 @@
# run installed tests
import ./make-test.nix ({ pkgs, ... }:
{
name = "glib-networking";
meta = {
maintainers = pkgs.glib-networking.meta.maintainers;
};
machine = { pkgs, ... }: {
environment.systemPackages = with pkgs; [ gnome-desktop-testing ];
};
testScript = ''
$machine->succeed("gnome-desktop-testing-runner -d '${pkgs.glib-networking.installedTests}/share'");
'';
})

View File

@ -3,9 +3,11 @@
, substituteAll , substituteAll
, meson , meson
, ninja , ninja
, nixosTests
, pkgconfig , pkgconfig
, glib , glib
, gettext , gettext
, makeWrapper
, python3 , python3
, gnutls , gnutls
, p11-kit , p11-kit
@ -18,6 +20,8 @@ stdenv.mkDerivation rec {
pname = "glib-networking"; pname = "glib-networking";
version = "2.60.3"; version = "2.60.3";
outputs = [ "out" "installedTests" ];
src = fetchurl { src = fetchurl {
url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
sha256 = "1mfw44qpmwvz6yzj8c6spx6z357wrmkk15byrkc5byagd82860fm"; sha256 = "1mfw44qpmwvz6yzj8c6spx6z357wrmkk15byrkc5byagd82860fm";
@ -28,6 +32,8 @@ stdenv.mkDerivation rec {
src = ./hardcode-gsettings.patch; src = ./hardcode-gsettings.patch;
gds_gsettings_path = glib.getSchemaPath gsettings-desktop-schemas; gds_gsettings_path = glib.getSchemaPath gsettings-desktop-schemas;
}) })
./installed-tests-path.patch
]; ];
postPatch = '' postPatch = ''
@ -40,6 +46,7 @@ stdenv.mkDerivation rec {
ninja ninja
pkgconfig pkgconfig
gettext gettext
makeWrapper
python3 # for install_script python3 # for install_script
]; ];
@ -53,10 +60,27 @@ stdenv.mkDerivation rec {
doCheck = false; # tests need to access the certificates (among other things) doCheck = false; # tests need to access the certificates (among other things)
mesonFlags = [
"-Dinstalled_tests=true"
"-Dinstalled_test_prefix=${placeholder "installedTests"}"
];
postFixup = ''
find "$installedTests/libexec" "$out/libexec" -type f -executable -print0 \
| while IFS= read -r -d "" file; do
echo "Wrapping program '$file'"
wrapProgram "$file" --prefix GIO_EXTRA_MODULES : "$out/lib/gio/modules"
done
'';
passthru = { passthru = {
updateScript = gnome3.updateScript { updateScript = gnome3.updateScript {
packageName = pname; packageName = pname;
}; };
tests = {
installedTests = nixosTests.glib-networking;
};
}; };
meta = with stdenv.lib; { meta = with stdenv.lib; {

View File

@ -0,0 +1,25 @@
diff --git a/meson.build b/meson.build
index 4d91677..aaaeb2b 100644
--- a/meson.build
+++ b/meson.build
@@ -12,8 +12,8 @@
libexecdir = join_paths(prefix, get_option('libexecdir'))
localedir = join_paths(prefix, get_option('localedir'))
-installed_tests_metadir = join_paths(datadir, 'installed-tests', meson.project_name())
-installed_tests_execdir = join_paths(libexecdir, 'installed-tests', meson.project_name())
+installed_tests_metadir = join_paths(get_option('installed_test_prefix'), 'share', 'installed-tests', meson.project_name())
+installed_tests_execdir = join_paths(get_option('installed_test_prefix'), 'libexec', 'installed-tests', meson.project_name())
cc = meson.get_compiler('c')
host_system = host_machine.system()
diff --git a/meson_options.txt b/meson_options.txt
index 3a525dd..fc86302 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -3,4 +3,5 @@
option('libproxy', type: 'feature', value: 'auto', description: 'support for libproxy proxy configration')
option('gnome_proxy', type: 'feature', value: 'auto', description: 'support for GNOME desktop proxy configuration')
option('installed_tests', type: 'boolean', value: false, description: 'enable installed tests')
+option('installed_test_prefix', type: 'string', value: '', description: 'Prefix for installed tests')
option('static_modules', type: 'boolean', value: false, description: 'build static modules')