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.
20.02
Emery Hemingway 3 years ago
parent b2d4dc491e
commit 1d3e849bc4
  1. 10
      tests/driver-linux.nix
  2. 17
      tests/driver-nova.nix
  3. 4
      tests/fs_report.nix
  4. 6
      tests/libc.nix
  5. 6
      tests/log.nix
  6. 6
      tests/pci.nix
  7. 6
      tests/signal.nix
  8. 6
      tests/solo5-ping.nix
  9. 6
      tests/solo5.nix

@ -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));
}

@ -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));
}

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

@ -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";

@ -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";

@ -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";

@ -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";

@ -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";

@ -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";

Loading…
Cancel
Save