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:
parent
b2d4dc491e
commit
1d3e849bc4
|
@ -36,7 +36,7 @@ let
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
makeTest = { name ? "unamed", testScript, testConfig, bootModules, ... }@t:
|
mkTest = { name ? "unamed", testScript, testConfig, bootModules, ... }@t:
|
||||||
with testPkgs;
|
with testPkgs;
|
||||||
let
|
let
|
||||||
bootModules' = {
|
bootModules' = {
|
||||||
|
@ -85,8 +85,12 @@ let
|
||||||
|
|
||||||
in {
|
in {
|
||||||
callTest = path: args:
|
callTest = path: args:
|
||||||
makeTest (import path ({
|
(import path ({
|
||||||
|
testEnv = {
|
||||||
|
inherit mkTest lib;
|
||||||
|
isLinux = true;
|
||||||
|
isNova = false;
|
||||||
|
};
|
||||||
pkgs = testPkgs;
|
pkgs = testPkgs;
|
||||||
inherit lib;
|
|
||||||
} // args));
|
} // args));
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,8 +41,8 @@ let
|
||||||
coreNovaObj = "${testPkgs.depot.base-nova}/lib/core-nova.o";
|
coreNovaObj = "${testPkgs.depot.base-nova}/lib/core-nova.o";
|
||||||
};
|
};
|
||||||
|
|
||||||
makeTest = { name ? "unamed", testScript, testConfig, bootModules
|
mkTest = { name ? "unamed", testScript, testConfig, bootModules, qemuMem ? 32
|
||||||
, qemuMem ? 32, ... }@t:
|
, ... }@t:
|
||||||
let
|
let
|
||||||
iso = mkIso (with testPkgs;
|
iso = mkIso (with testPkgs;
|
||||||
{
|
{
|
||||||
|
@ -130,12 +130,19 @@ let
|
||||||
|
|
||||||
test = passMeta (runTests driver);
|
test = passMeta (runTests driver);
|
||||||
|
|
||||||
in test // { inherit driver iso test; config = testConfig; };
|
in test // {
|
||||||
|
inherit driver iso test;
|
||||||
|
config = testConfig;
|
||||||
|
};
|
||||||
|
|
||||||
in {
|
in {
|
||||||
callTest = path: args:
|
callTest = path: args:
|
||||||
makeTest (import path ({
|
(import path ({
|
||||||
|
testEnv = {
|
||||||
|
inherit mkTest lib;
|
||||||
|
isLinux = false;
|
||||||
|
isNova = true;
|
||||||
|
};
|
||||||
pkgs = testPkgs;
|
pkgs = testPkgs;
|
||||||
inherit lib;
|
|
||||||
} // args));
|
} // args));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{ pkgs, lib }:
|
{ testEnv, pkgs }:
|
||||||
with pkgs;
|
with pkgs;
|
||||||
|
|
||||||
{
|
testEnv.mkTest {
|
||||||
name = "fs_report";
|
name = "fs_report";
|
||||||
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ehmry ];
|
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ehmry ];
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
{ pkgs, lib }:
|
{ testEnv, pkgs }:
|
||||||
with pkgs;
|
with pkgs;
|
||||||
|
|
||||||
rec {
|
testEnv.mkTest rec {
|
||||||
name = "libc";
|
name = "libc";
|
||||||
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ehmry ];
|
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ehmry ];
|
||||||
|
|
||||||
testConfig = lib.renderDhallInit ./libc.dhall "{=}";
|
testConfig = testEnv.lib.renderDhallInit ./libc.dhall "{=}";
|
||||||
|
|
||||||
bootModules = {
|
bootModules = {
|
||||||
"libc.lib.so" = "${depot.libc}/lib/libc.lib.so";
|
"libc.lib.so" = "${depot.libc}/lib/libc.lib.so";
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
{ pkgs, lib }:
|
{ testEnv, pkgs }:
|
||||||
with pkgs;
|
with pkgs;
|
||||||
|
|
||||||
rec {
|
testEnv.mkTest rec {
|
||||||
name = "log";
|
name = "log";
|
||||||
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ehmry ];
|
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";
|
bootModules.test-log = "${depot.test-log}/bin/test-log";
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
{ pkgs, lib }:
|
{ testEnv, pkgs }:
|
||||||
with pkgs;
|
with pkgs;
|
||||||
|
|
||||||
{
|
testEnv.mkTest {
|
||||||
name = "pci";
|
name = "pci";
|
||||||
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ehmry ];
|
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ehmry ];
|
||||||
|
|
||||||
testConfig = lib.renderDhallInit ./pci.dhall "{=}";
|
testConfig = testEnv.lib.renderDhallInit ./pci.dhall "{=}";
|
||||||
|
|
||||||
bootModules = {
|
bootModules = {
|
||||||
acpi_drv = "${genode.os}/bin/acpi_drv";
|
acpi_drv = "${genode.os}/bin/acpi_drv";
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
{ pkgs, lib }:
|
{ testEnv, pkgs }:
|
||||||
with pkgs;
|
with pkgs;
|
||||||
|
|
||||||
rec {
|
testEnv.mkTest rec {
|
||||||
name = "signal";
|
name = "signal";
|
||||||
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ehmry ];
|
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";
|
bootModules.test-signal = "${depot.test-signal}/bin/test-signal";
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
{ pkgs, lib }:
|
{ testEnv, pkgs }:
|
||||||
with pkgs;
|
with pkgs;
|
||||||
|
|
||||||
rec {
|
testEnv.mkTest rec {
|
||||||
name = "solo5";
|
name = "solo5";
|
||||||
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ehmry ];
|
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ehmry ];
|
||||||
|
|
||||||
testConfig = lib.renderDhallInit ./solo5-ping.dhall "{=}";
|
testConfig = testEnv.lib.renderDhallInit ./solo5-ping.dhall "{=}";
|
||||||
|
|
||||||
bootModules = {
|
bootModules = {
|
||||||
nic_bridge = "${genode.os}/bin/nic_bridge";
|
nic_bridge = "${genode.os}/bin/nic_bridge";
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
{ pkgs, lib }:
|
{ testEnv, pkgs }:
|
||||||
with pkgs;
|
with pkgs;
|
||||||
|
|
||||||
rec {
|
testEnv.mkTest rec {
|
||||||
name = "solo5";
|
name = "solo5";
|
||||||
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ehmry ];
|
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ehmry ];
|
||||||
|
|
||||||
testConfig = lib.renderDhallInit ./solo5.dhall "{=}";
|
testConfig = testEnv.lib.renderDhallInit ./solo5.dhall "{=}";
|
||||||
|
|
||||||
bootModules = {
|
bootModules = {
|
||||||
sequence = "${genode.os}/bin/sequence";
|
sequence = "${genode.os}/bin/sequence";
|
||||||
|
|
Loading…
Reference in New Issue