2
0
Fork 0

Pass a testEnv attrset when importing test files

This allows test files to contain multiple test derivations and check
test harness attributes.
This commit is contained in:
Ehmry - 2019-10-22 19:24:02 +02:00
parent b2d4dc491e
commit 1d3e849bc4
9 changed files with 39 additions and 28 deletions

View File

@ -36,7 +36,7 @@ let
'';
};
makeTest = { name ? "unamed", testScript, testConfig, bootModules, ... }@t:
mkTest = { name ? "unamed", testScript, testConfig, bootModules, ... }@t:
with testPkgs;
let
bootModules' = {
@ -85,8 +85,12 @@ let
in {
callTest = path: args:
makeTest (import path ({
(import path ({
testEnv = {
inherit mkTest lib;
isLinux = true;
isNova = false;
};
pkgs = testPkgs;
inherit lib;
} // args));
}

View File

@ -41,8 +41,8 @@ let
coreNovaObj = "${testPkgs.depot.base-nova}/lib/core-nova.o";
};
makeTest = { name ? "unamed", testScript, testConfig, bootModules
, qemuMem ? 32, ... }@t:
mkTest = { name ? "unamed", testScript, testConfig, bootModules, qemuMem ? 32
, ... }@t:
let
iso = mkIso (with testPkgs;
{
@ -130,12 +130,19 @@ let
test = passMeta (runTests driver);
in test // { inherit driver iso test; config = testConfig; };
in test // {
inherit driver iso test;
config = testConfig;
};
in {
callTest = path: args:
makeTest (import path ({
(import path ({
testEnv = {
inherit mkTest lib;
isLinux = false;
isNova = true;
};
pkgs = testPkgs;
inherit lib;
} // args));
}

View File

@ -1,7 +1,7 @@
{ pkgs, lib }:
{ testEnv, pkgs }:
with pkgs;
{
testEnv.mkTest {
name = "fs_report";
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ehmry ];

View File

@ -1,11 +1,11 @@
{ pkgs, lib }:
{ testEnv, pkgs }:
with pkgs;
rec {
testEnv.mkTest rec {
name = "libc";
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ehmry ];
testConfig = lib.renderDhallInit ./libc.dhall "{=}";
testConfig = testEnv.lib.renderDhallInit ./libc.dhall "{=}";
bootModules = {
"libc.lib.so" = "${depot.libc}/lib/libc.lib.so";

View File

@ -1,11 +1,11 @@
{ pkgs, lib }:
{ testEnv, pkgs }:
with pkgs;
rec {
testEnv.mkTest rec {
name = "log";
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ehmry ];
testConfig = lib.renderDhallInit ./log.dhall "{=}";
testConfig = testEnv.lib.renderDhallInit ./log.dhall "{=}";
bootModules.test-log = "${depot.test-log}/bin/test-log";

View File

@ -1,11 +1,11 @@
{ pkgs, lib }:
{ testEnv, pkgs }:
with pkgs;
{
testEnv.mkTest {
name = "pci";
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ehmry ];
testConfig = lib.renderDhallInit ./pci.dhall "{=}";
testConfig = testEnv.lib.renderDhallInit ./pci.dhall "{=}";
bootModules = {
acpi_drv = "${genode.os}/bin/acpi_drv";

View File

@ -1,11 +1,11 @@
{ pkgs, lib }:
{ testEnv, pkgs }:
with pkgs;
rec {
testEnv.mkTest rec {
name = "signal";
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ehmry ];
testConfig = lib.renderDhallInit ./signal.dhall "{=}";
testConfig = testEnv.lib.renderDhallInit ./signal.dhall "{=}";
bootModules.test-signal = "${depot.test-signal}/bin/test-signal";

View File

@ -1,11 +1,11 @@
{ pkgs, lib }:
{ testEnv, pkgs }:
with pkgs;
rec {
testEnv.mkTest rec {
name = "solo5";
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ehmry ];
testConfig = lib.renderDhallInit ./solo5-ping.dhall "{=}";
testConfig = testEnv.lib.renderDhallInit ./solo5-ping.dhall "{=}";
bootModules = {
nic_bridge = "${genode.os}/bin/nic_bridge";

View File

@ -1,11 +1,11 @@
{ pkgs, lib }:
{ testEnv, pkgs }:
with pkgs;
rec {
testEnv.mkTest rec {
name = "solo5";
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ehmry ];
testConfig = lib.renderDhallInit ./solo5.dhall "{=}";
testConfig = testEnv.lib.renderDhallInit ./solo5.dhall "{=}";
bootModules = {
sequence = "${genode.os}/bin/sequence";