91 lines
1.7 KiB
Nix
91 lines
1.7 KiB
Nix
# SPDX-License-Identifier: CC0-1.0
|
|
|
|
{ testEnv, pkgs, ... }:
|
|
with pkgs;
|
|
|
|
let
|
|
defaultScript = ''
|
|
run_genode_until {child "solo5" exited with exit value 0} 30
|
|
'';
|
|
|
|
mkTest' = { name, testConfig, testScript ? defaultScript, ... }@attrs:
|
|
testEnv.mkTest (attrs // {
|
|
name = "solo5-" + name;
|
|
inherit testScript;
|
|
env = {
|
|
SOLO5_MANIFEST = pkgs.solo5.manifest;
|
|
SOLO5_TEST_MANIFEST = pkgs.solo5.tests.manifest;
|
|
};
|
|
testConfig = "(${./boot-wrapper.dhall} ${testConfig})";
|
|
});
|
|
|
|
applyMkTest = x: {
|
|
inherit (x) name;
|
|
value = mkTest' x;
|
|
};
|
|
|
|
mkTests = testList: builtins.listToAttrs (map applyMkTest testList);
|
|
|
|
toSimple = name:
|
|
"(${./simple.dhall} (env:SOLO5_TEST_MANIFEST).bin.solo5-test_${name})";
|
|
|
|
tests = [
|
|
{
|
|
name = "blk";
|
|
testConfig = ./blk.dhall;
|
|
}
|
|
|
|
{
|
|
name = "fpu";
|
|
testConfig = toSimple "fpu";
|
|
}
|
|
|
|
{
|
|
name = "globals";
|
|
testConfig = toSimple "globals";
|
|
}
|
|
|
|
{
|
|
name = "hello";
|
|
testConfig = toSimple "hello";
|
|
}
|
|
|
|
{
|
|
name = "net";
|
|
testConfig = ./net.dhall;
|
|
testScript = ''
|
|
run_genode_until {child "ping" exited with exit value 0} 30
|
|
'';
|
|
}
|
|
|
|
{
|
|
name = "net_2if";
|
|
testConfig = ./net_2if.dhall;
|
|
testScript = ''
|
|
run_genode_until {child "clients" exited with exit value 0} 30
|
|
'';
|
|
qemuMem = 64;
|
|
}
|
|
|
|
{
|
|
name = "quiet";
|
|
testConfig = toSimple "quiet";
|
|
}
|
|
|
|
{
|
|
name = "ssp";
|
|
testConfig = toSimple "ssp";
|
|
testScript = ''
|
|
run_genode_until {Error: stack protector check failed} 30
|
|
'';
|
|
}
|
|
|
|
] ++ (testEnv.lib.optional (!testEnv.isLinux) {
|
|
name = "time";
|
|
testConfig = ./time.dhall;
|
|
}
|
|
|
|
);
|
|
|
|
in mkTests tests
|