sigil/tests/default.nix
Emery Hemingway 693ac303e0 Use a host-only Nixpkgs for test environment
Discriminate test-packages and host-packages when building tests.
This avoids the test tooling being tainted with the hostPlatform
and targetPlatform of the test. For example, QEMU must be built
independently and isolated from the guest platform, for the sake
of test control and minimizing rebuilds.
2019-10-07 17:21:06 +02:00

42 lines
1.2 KiB
Nix

# SPDX-FileCopyrightText: Emery Hemingway
#
# SPDX-License-Identifier: LicenseRef-Hippocratic-1.1
let
tests = call: {
fs_report = call ./fs_report.nix { };
libc = call ./libc.nix { };
log = call ./log.nix { };
signal = call ./signal.nix { };
solo5 = call ./solo5.nix { };
};
nixpkgs' = import ./../nixpkgs.nix;
in { nixpkgs ? nixpkgs' }:
let
hostPkgs = import nixpkgs { };
testPkgs = import ./.. { inherit nixpkgs; };
lib = hostPkgs.lib // {
renderDhallInit = path: args:
hostPkgs.runCommand "init.xml" {
buildInputs = [ testPkgs.buildPackages.linux-dhall ];
initConfig = path;
initArgs = args;
DHALL_PRELUDE = "${testPkgs.dhallPackages.prelude}/package.dhall";
DHALL_GENODE = "${testPkgs.dhallPackages.genode}/package.dhall";
} ''
export XDG_CACHE_HOME=$NIX_BUILD_TOP
echo 'let Prelude = env:DHALL_GENODE in Prelude.Init.render (Prelude.Init.defaults { children = toMap (env:initConfig env:initArgs) })' \
| dhall text \
> $out
'';
};
in {
linux = tests
(import ./driver-linux.nix { inherit testPkgs hostPkgs lib; }).callTest;
}