mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-11-09 14:45:58 +01:00
Compare commits
1 commit
0a38bafada
...
2476ee1596
Author | SHA1 | Date | |
---|---|---|---|
|
2476ee1596 |
3 changed files with 40 additions and 42 deletions
|
@ -2,7 +2,6 @@
|
|||
inputs,
|
||||
nixosTest,
|
||||
homeManagerModules,
|
||||
testProfile,
|
||||
...
|
||||
}:
|
||||
nixosTest {
|
||||
|
@ -11,8 +10,8 @@ nixosTest {
|
|||
|
||||
nodes.machine = {
|
||||
imports = [
|
||||
testProfile
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
../profiles/minimal.nix
|
||||
];
|
||||
|
||||
config = {
|
||||
|
@ -29,5 +28,39 @@ nixosTest {
|
|||
};
|
||||
};
|
||||
|
||||
testScript = "";
|
||||
testScript = ''
|
||||
import subprocess
|
||||
machine.wait_for_unit("default.target")
|
||||
|
||||
def check_errs(process):
|
||||
# Check for errors
|
||||
print("Connecting to Neovim process")
|
||||
|
||||
# Capture stdout and stderr
|
||||
stdout, stderr = process.communicate()
|
||||
|
||||
# Print captured stdout and stderr
|
||||
if stdout:
|
||||
print("Captured stdout:")
|
||||
print(stdout.decode('utf-8'))
|
||||
if stderr:
|
||||
print("Captured stderr:")
|
||||
print(stderr.decode('utf-8'))
|
||||
|
||||
def run_neovim_headless():
|
||||
print("Running Neovim in headless mode.")
|
||||
|
||||
# Run Neovim in headless mode
|
||||
nvim_process = subprocess.Popen(['nvim', '--headless'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
|
||||
check_errs(nvim_process)
|
||||
|
||||
# Load configuration file
|
||||
nvim_process.stdin.write(b':NonExistentCommand\n')
|
||||
nvim_process.stdin.flush()
|
||||
|
||||
# run Neovim in headless mode
|
||||
# and expect it to return sucessfully
|
||||
machine.succeed(run_neovim_headless())
|
||||
'';
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
{
|
||||
nixosTest,
|
||||
nixosModules,
|
||||
testProfile,
|
||||
...
|
||||
}:
|
||||
nixosTest {
|
||||
|
@ -9,8 +8,8 @@ nixosTest {
|
|||
|
||||
nodes.machine = {
|
||||
imports = [
|
||||
testProfile
|
||||
nixosModules.nvf
|
||||
../profiles/minimal.nix
|
||||
];
|
||||
|
||||
config = {
|
||||
|
@ -18,39 +17,5 @@ nixosTest {
|
|||
};
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
import subprocess
|
||||
machine.wait_for_unit("default.target")
|
||||
|
||||
def check_errs(process):
|
||||
# Check for errors
|
||||
print("Connecting to Neovim process")
|
||||
|
||||
# Capture stdout and stderr
|
||||
stdout, stderr = process.communicate()
|
||||
|
||||
# Print captured stdout and stderr
|
||||
if stdout:
|
||||
print("Captured stdout:")
|
||||
print(stdout.decode('utf-8'))
|
||||
if stderr:
|
||||
print("Captured stderr:")
|
||||
print(stderr.decode('utf-8'))
|
||||
|
||||
def run_neovim_headless():
|
||||
print("Running Neovim in headless mode.")
|
||||
|
||||
# Run Neovim in headless mode
|
||||
nvim_process = subprocess.Popen(['nvim', '--headless'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
|
||||
check_errs(nvim_process)
|
||||
|
||||
# Load configuration file
|
||||
nvim_process.stdin.write(b':NonExistentCommand\n')
|
||||
nvim_process.stdin.flush()
|
||||
|
||||
# run Neovim in headless mode
|
||||
# and expect it to return sucessfully
|
||||
machine.succeed(run_neovim_headless())
|
||||
'';
|
||||
testScript = "";
|
||||
}
|
||||
|
|
|
@ -16,20 +16,20 @@
|
|||
defaultInherits = {
|
||||
inherit (config.flake) homeManagerModules nixosModules;
|
||||
inherit inputs;
|
||||
testProfile = ./profiles/minimal.nix;
|
||||
};
|
||||
|
||||
callPackage = callPackageWith (recursiveUpdate pkgs defaultInherits);
|
||||
in {
|
||||
checks = packagesFromDirectoryRecursive {
|
||||
inherit callPackage;
|
||||
testProfile = ../profiles/minimal.nix;
|
||||
directory = ./checks;
|
||||
};
|
||||
|
||||
# expose checks as packages to be built
|
||||
packages = {
|
||||
test-home-manager-module = self'.checks.homeManagerModule.driverInteractive;
|
||||
# test-nixos-module = self'.checks.nixosModule.driverInteractive;
|
||||
test-nixos-module = self'.checks.nixosModule.driverInteractive;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue