nixosTests.installed-tests: allow passing extra makeTest args
For example, extra meta tags.
This commit is contained in:
parent
175359cfac
commit
973c2fcf3d
@ -29,36 +29,51 @@ let
|
|||||||
|
|
||||||
# Extra flags to pass to gnome-desktop-testing-runner.
|
# Extra flags to pass to gnome-desktop-testing-runner.
|
||||||
, testRunnerFlags ? ""
|
, testRunnerFlags ? ""
|
||||||
}:
|
|
||||||
makeTest rec {
|
|
||||||
name = tested.name;
|
|
||||||
|
|
||||||
meta = {
|
# Extra attributes to pass to makeTest.
|
||||||
maintainers = tested.meta.maintainers;
|
# They will be recursively merged into the attrset created by this function.
|
||||||
};
|
, ...
|
||||||
|
}@args:
|
||||||
|
makeTest
|
||||||
|
(recursiveUpdate
|
||||||
|
rec {
|
||||||
|
name = tested.name;
|
||||||
|
|
||||||
machine = { ... }: {
|
meta = {
|
||||||
imports = [
|
maintainers = tested.meta.maintainers;
|
||||||
testConfig
|
};
|
||||||
] ++ optional withX11 ../common/x11.nix;
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [ gnome-desktop-testing ];
|
machine = { ... }: {
|
||||||
|
imports = [
|
||||||
|
testConfig
|
||||||
|
] ++ optional withX11 ../common/x11.nix;
|
||||||
|
|
||||||
};
|
environment.systemPackages = with pkgs; [ gnome-desktop-testing ];
|
||||||
|
|
||||||
testScript =
|
};
|
||||||
optionalString withX11 ''
|
|
||||||
machine.wait_for_x()
|
testScript =
|
||||||
'' +
|
optionalString withX11 ''
|
||||||
optionalString (preTestScript != "") ''
|
machine.wait_for_x()
|
||||||
${preTestScript}
|
'' +
|
||||||
'' +
|
optionalString (preTestScript != "") ''
|
||||||
''
|
${preTestScript}
|
||||||
machine.succeed(
|
'' +
|
||||||
"gnome-desktop-testing-runner ${testRunnerFlags} -d '${tested.installedTests}/share'"
|
''
|
||||||
)
|
machine.succeed(
|
||||||
'';
|
"gnome-desktop-testing-runner ${testRunnerFlags} -d '${tested.installedTests}/share'"
|
||||||
};
|
)
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
(removeAttrs args [
|
||||||
|
"tested"
|
||||||
|
"testConfig"
|
||||||
|
"preTestScript"
|
||||||
|
"withX11"
|
||||||
|
"testRunnerFlags"
|
||||||
|
])
|
||||||
|
);
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user