mirror of
https://github.com/fort-nix/nix-bitcoin.git
synced 2024-11-30 03:32:05 +03:00
31 lines
755 B
Nix
31 lines
755 B
Nix
pkgs:
|
|
let
|
|
pythonTesting = import (pkgs.path + "/nixos/lib/testing-python.nix") {
|
|
system = pkgs.stdenv.hostPlatform.system;
|
|
inherit pkgs;
|
|
};
|
|
in
|
|
|
|
module:
|
|
let
|
|
test = (pythonTesting.evalTest module).config;
|
|
|
|
runTest = pkgs.stdenv.mkDerivation {
|
|
name = "vm-test-run-${test.name}";
|
|
|
|
requiredSystemFeatures = [ "kvm" "nixos-test" ];
|
|
|
|
# 1. Save test logging output
|
|
# 2. Add link to driver so that a gcroot to a test prevents the driver from
|
|
# being garbage-collected
|
|
buildCommand = ''
|
|
mkdir "$out"
|
|
LOGFILE=$out/output.xml tests='exec(os.environ["testScript"])' ${test.driver}/bin/nixos-test-driver
|
|
ln -s ${test.driver} "$out/driver"
|
|
'';
|
|
|
|
inherit (test) meta passthru;
|
|
} // test;
|
|
in
|
|
runTest
|