diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index df2b65173510..847b8bb5f0cc 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -517,6 +517,7 @@ in { #logstash = handleTest ./logstash.nix {}; lomiri = handleTest ./lomiri.nix {}; lomiri-calculator-app = runTest ./lomiri-calculator-app.nix; + lomiri-clock-app = runTest ./lomiri-clock-app.nix; lomiri-filemanager-app = runTest ./lomiri-filemanager-app.nix; lomiri-system-settings = handleTest ./lomiri-system-settings.nix {}; lorri = handleTest ./lorri/default.nix {}; diff --git a/nixos/tests/lomiri-clock-app.nix b/nixos/tests/lomiri-clock-app.nix new file mode 100644 index 000000000000..e68b89def534 --- /dev/null +++ b/nixos/tests/lomiri-clock-app.nix @@ -0,0 +1,48 @@ +{ pkgs, lib, ... }: +{ + name = "lomiri-clock-app-standalone"; + meta.maintainers = lib.teams.lomiri.members; + + nodes.machine = + { config, pkgs, ... }: + { + imports = [ ./common/x11.nix ]; + + services.xserver.enable = true; + + environment = { + systemPackages = with pkgs.lomiri; [ + suru-icon-theme + lomiri-clock-app + ]; + variables = { + UITK_ICON_THEME = "suru"; + }; + }; + + i18n.supportedLocales = [ "all" ]; + + fonts.packages = with pkgs; [ + # Intended font & helps with OCR + ubuntu_font_family + ]; + }; + + enableOCR = true; + + testScript = '' + machine.wait_for_x() + + with subtest("lomiri clock launches"): + machine.execute("lomiri-clock-app >&2 &") + machine.wait_for_text(r"(clock.ubports|City|Alarms)") + machine.screenshot("lomiri-clock_open") + + machine.succeed("pkill -f lomiri-clock-app") + + with subtest("lomiri clock localisation works"): + machine.execute("env LANG=de_DE.UTF-8 lomiri-clock-app >&2 &") + machine.wait_for_text(r"(Stadt|Weckzeiten)") + machine.screenshot("lomiri-clock_localised") + ''; +} diff --git a/pkgs/desktops/lomiri/applications/lomiri-clock-app/default.nix b/pkgs/desktops/lomiri/applications/lomiri-clock-app/default.nix index cd380838bb99..6c9fbc474ebd 100644 --- a/pkgs/desktops/lomiri/applications/lomiri-clock-app/default.nix +++ b/pkgs/desktops/lomiri/applications/lomiri-clock-app/default.nix @@ -4,6 +4,7 @@ fetchFromGitLab, fetchpatch, gitUpdater, + nixosTests, cmake, content-hub, geonames, @@ -204,6 +205,7 @@ stdenv.mkDerivation (finalAttrs: { ''; passthru = { + tests.vm = nixosTests.lomiri-clock-app; updateScript = gitUpdater { rev-prefix = "v"; }; };