Skip to content

Commit

Permalink
tests for wrapper code
Browse files Browse the repository at this point in the history
to do: tests for patched code
will be squashed before merge
  • Loading branch information
cwyc committed May 25, 2022
1 parent b79df1a commit 5ebf782
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions pkgs/build-support/setup-hooks/wrap-gapps-hook/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,29 @@ makeSetupHook {
''
);

# Stopgap as no modules have been packaged yet
mock-pixbuf-module = stdenv.mkDerivation {
name = "mock-gdk-pixbuf-module";
outputs = ["lib"];
builder = ''
mkdir -p $lib/$(dirname ${gdk-pixbuf.cacheFile})
touch $lib/${gdk-pixbuf.cacheFile}
'';
};

pixbuf-modules = basic.overrideAttrs (old: {extraGdkPixbufModules = [mock-pixbuf-module];});

pixbuf-modules-check = let
tested = pixbuf-modules;
in testLib.runTest "pixbuf-modules-check" ''
${expectSomeLineContainingYInFileXToMentionZ "${tested}/bin/foo" "GDK_PIXBUF_MODULE_FILE=" "${gdk-pixbuf}/${gdk-pixbuf.cacheFile}"}
${expectSomeLineContainingYInFileXToMentionZ "${tested}/bin/foo" "GDK_PIXBUF_MODULE_FILE=" "${librsvg}/${gdk-pixbuf.cacheFile}"}
${expectSomeLineContainingYInFileXToMentionZ "${tested}/bin/foo" "GDK_PIXBUF_MODULE_FILE=" "${mock-pixbuf-module}/${gdk-pixbuf.cacheFile}"}
${expectSomeLineContainingYInFileXToMentionZ "${tested}/libexec/bar" "GDK_PIXBUF_MODULE_FILE=" "${gdk-pixbuf}/${gdk-pixbuf.cacheFile}"}
${expectSomeLineContainingYInFileXToMentionZ "${tested}/libexec/bar" "GDK_PIXBUF_MODULE_FILE=" "${librsvg}/${gdk-pixbuf.cacheFile}"}
${expectSomeLineContainingYInFileXToMentionZ "${tested}/libexec/bar" "GDK_PIXBUF_MODULE_FILE=" "${mock-pixbuf-module}/${gdk-pixbuf.cacheFile}"}
'';

# Simple derivation containing a gobject-introspection typelib.
typelib-Mahjong = stdenv.mkDerivation {
name = "typelib-Mahjong";
Expand Down

0 comments on commit 5ebf782

Please sign in to comment.