nixos/starship: add a test
This commit is contained in:
parent
3f1ef8fe14
commit
f366ae6429
|
@ -445,6 +445,7 @@ in
|
|||
sslh = handleTest ./sslh.nix {};
|
||||
sssd = handleTestOn ["x86_64-linux"] ./sssd.nix {};
|
||||
sssd-ldap = handleTestOn ["x86_64-linux"] ./sssd-ldap.nix {};
|
||||
starship = handleTest ./starship.nix {};
|
||||
step-ca = handleTestOn ["x86_64-linux"] ./step-ca.nix {};
|
||||
strongswan-swanctl = handleTest ./strongswan-swanctl.nix {};
|
||||
sudo = handleTest ./sudo.nix {};
|
||||
|
|
31
nixos/tests/starship.nix
Normal file
31
nixos/tests/starship.nix
Normal file
|
@ -0,0 +1,31 @@
|
|||
import ./make-test-python.nix ({ pkgs, ... }: {
|
||||
name = "starship";
|
||||
meta.maintainers = pkgs.starship.meta.maintainers;
|
||||
|
||||
machine = {
|
||||
programs = {
|
||||
fish.enable = true;
|
||||
zsh.enable = true;
|
||||
|
||||
starship = {
|
||||
enable = true;
|
||||
settings.format = "<starship>";
|
||||
};
|
||||
};
|
||||
|
||||
services.getty.autologinUser = "root";
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
start_all()
|
||||
machine.wait_for_unit("default.target")
|
||||
|
||||
for shell in ["bash", "fish", "zsh"]:
|
||||
machine.send_chars(f"script -c {shell} /tmp/{shell}.txt\n")
|
||||
machine.wait_until_tty_matches(1, f"Script started.*{shell}.txt")
|
||||
machine.send_chars("exit\n")
|
||||
machine.wait_until_tty_matches(1, "Script done")
|
||||
machine.sleep(1)
|
||||
machine.succeed(f"grep -q '<starship>' /tmp/{shell}.txt")
|
||||
'';
|
||||
})
|
|
@ -6,6 +6,7 @@
|
|||
, openssl
|
||||
, installShellFiles
|
||||
, libiconv
|
||||
, nixosTests
|
||||
, Security
|
||||
}:
|
||||
|
||||
|
@ -40,6 +41,10 @@ rustPlatform.buildRustPackage rec {
|
|||
HOME=$TMPDIR
|
||||
'';
|
||||
|
||||
passthru.tests = {
|
||||
inherit (nixosTests) starship;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "A minimal, blazing fast, and extremely customizable prompt for any shell";
|
||||
homepage = "https://starship.rs";
|
||||
|
|
Loading…
Reference in a new issue