2024-11-06 19:08:39 +00:00
|
|
|
import ./make-test-python.nix (
|
|
|
|
{ pkgs, ... }:
|
2022-02-04 23:50:11 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
name = "retroarch";
|
2024-11-06 19:08:39 +00:00
|
|
|
meta = with pkgs.lib; {
|
|
|
|
maintainers = teams.libretro.members ++ [ maintainers.j0hax ];
|
|
|
|
};
|
2022-02-04 23:50:11 +00:00
|
|
|
|
2024-11-06 19:08:39 +00:00
|
|
|
nodes.machine =
|
|
|
|
{ ... }:
|
2022-02-04 23:50:11 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
imports = [ ./common/user-account.nix ];
|
|
|
|
services.xserver.enable = true;
|
|
|
|
services.xserver.desktopManager.retroarch = {
|
|
|
|
enable = true;
|
2022-10-01 11:24:46 +00:00
|
|
|
package = pkgs.retroarchBare;
|
2022-02-04 23:50:11 +00:00
|
|
|
};
|
|
|
|
services.xserver.displayManager = {
|
|
|
|
sddm.enable = true;
|
|
|
|
defaultSession = "RetroArch";
|
|
|
|
autoLogin = {
|
|
|
|
enable = true;
|
|
|
|
user = "alice";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-11-06 19:08:39 +00:00
|
|
|
testScript =
|
|
|
|
{ nodes, ... }:
|
2022-02-04 23:50:11 +00:00
|
|
|
let
|
|
|
|
user = nodes.machine.config.users.users.alice;
|
|
|
|
xdo = "${pkgs.xdotool}/bin/xdotool";
|
2024-11-06 19:08:39 +00:00
|
|
|
in
|
|
|
|
''
|
2022-02-04 23:50:11 +00:00
|
|
|
with subtest("Wait for login"):
|
|
|
|
start_all()
|
2023-07-09 15:12:27 +00:00
|
|
|
machine.wait_for_file("/tmp/xauth_*")
|
|
|
|
machine.succeed("xauth merge /tmp/xauth_*")
|
2022-02-04 23:50:11 +00:00
|
|
|
|
|
|
|
with subtest("Check RetroArch started"):
|
|
|
|
machine.wait_until_succeeds("pgrep retroarch")
|
2024-11-06 19:09:10 +00:00
|
|
|
machine.wait_for_window("^RetroArch")
|
2022-02-04 23:50:11 +00:00
|
|
|
|
|
|
|
with subtest("Check configuration created"):
|
|
|
|
machine.wait_for_file("${user.home}/.config/retroarch/retroarch.cfg")
|
|
|
|
|
|
|
|
with subtest("Wait to get a screenshot"):
|
|
|
|
machine.execute(
|
|
|
|
"${xdo} key Alt+F1 sleep 10"
|
|
|
|
)
|
|
|
|
machine.screenshot("screen")
|
|
|
|
'';
|
2024-11-06 19:08:39 +00:00
|
|
|
}
|
|
|
|
)
|