2
0
Fork 0
genodepkgs/tests/default.nix

42 lines
1.2 KiB
Nix
Raw Normal View History

2019-10-03 19:50:34 +02:00
# 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 { };
2019-10-06 20:35:54 +02:00
solo5 = call ./solo5.nix { };
};
nixpkgs' = import ./../nixpkgs.nix;
in { nixpkgs ? nixpkgs' }:
2019-10-03 19:50:34 +02:00
let
hostPkgs = import nixpkgs { };
testPkgs = import ./.. { inherit nixpkgs; };
2019-10-03 19:50:34 +02:00
lib = hostPkgs.lib // {
2019-10-03 19:50:34 +02:00
renderDhallInit = path: args:
hostPkgs.runCommand "init.xml" {
buildInputs = [ testPkgs.buildPackages.linux-dhall ];
2019-10-03 19:50:34 +02:00
initConfig = path;
initArgs = args;
DHALL_PRELUDE = "${testPkgs.dhallPackages.prelude}/package.dhall";
DHALL_GENODE = "${testPkgs.dhallPackages.genode}/package.dhall";
2019-10-03 19:50:34 +02:00
} ''
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 \
2019-10-03 19:50:34 +02:00
> $out
'';
};
in {
linux = tests
(import ./driver-linux.nix { inherit testPkgs hostPkgs lib; }).callTest;
2019-10-03 19:50:34 +02:00
}