2
0
Fork 0
genodepkgs/tests/solo5/default.nix

81 lines
1.4 KiB
Nix
Raw Normal View History

2020-01-17 01:24:34 +01:00
# SPDX-License-Identifier: CC0-1.0
2020-01-14 12:16:02 +01:00
{ testEnv, pkgs, ... }:
2019-10-22 19:20:26 +02:00
with pkgs;
let
defaultScript = ''
run_genode_until {SUCCESS} 30
2019-10-22 19:20:26 +02:00
'';
2020-01-17 19:27:04 +01:00
mkTest' = { name, testConfig, testScript ? defaultScript, ... }@attrs:
2019-10-22 19:20:26 +02:00
testEnv.mkTest (attrs // {
name = "solo5-" + name;
inherit testScript;
testInputs = [ pkgs.solo5 pkgs.solo5.tests pkgs.driversPc ];
2020-01-17 19:27:04 +01:00
testConfig = "(${./boot-wrapper.dhall} ${testConfig})";
2019-10-22 19:20:26 +02:00
});
applyMkTest = x: {
inherit (x) name;
value = mkTest' x;
};
mkTests = testList: builtins.listToAttrs (map applyMkTest testList);
2020-01-17 19:27:04 +01:00
toSimple = name:
"(${./simple.dhall} (env:MANIFEST).solo5-tests.bin.solo5-test_${name})";
2020-01-17 19:27:04 +01:00
2019-10-22 19:20:26 +02:00
tests = [
{
name = "blk";
2020-01-17 19:27:04 +01:00
testConfig = ./blk.dhall;
2019-10-22 19:20:26 +02:00
}
{
name = "fpu";
2020-01-17 19:27:04 +01:00
testConfig = toSimple "fpu";
2019-10-22 19:20:26 +02:00
}
{
name = "globals";
2020-01-17 19:27:04 +01:00
testConfig = toSimple "globals";
2019-10-22 19:20:26 +02:00
}
{
name = "hello";
2020-01-17 19:27:04 +01:00
testConfig = toSimple "hello";
2019-10-22 19:20:26 +02:00
}
{
name = "net";
2020-01-17 19:27:04 +01:00
testConfig = ./net.dhall;
2019-10-22 19:20:26 +02:00
}
{
name = "net_2if";
2020-01-17 19:27:04 +01:00
testConfig = ./net_2if.dhall;
2019-10-22 19:20:26 +02:00
}
{
name = "quiet";
2020-01-17 19:27:04 +01:00
testConfig = toSimple "quiet";
2019-10-22 19:20:26 +02:00
}
{
name = "ssp";
2020-01-17 19:27:04 +01:00
testConfig = toSimple "ssp";
2019-10-22 19:20:26 +02:00
testScript = ''
run_genode_until {Error: stack protector check failed} 30
'';
}
] ++ (testEnv.lib.optional (!testEnv.isLinux) {
name = "time";
2020-01-17 19:27:04 +01:00
testConfig = ./time.dhall;
2019-10-22 19:20:26 +02:00
}
);
in mkTests tests