2
0
Fork 0
genodepkgs/tests/test-wrapper.dhall

76 lines
2.1 KiB
Plaintext

-- SPDX-License-Identifier: CC0-1.0
let Test = ./test.dhall ? env:DHALL_GENODE_TEST
let Genode = Test.Genode
let Prelude = Genode.Prelude
let Init = Genode.Init
let Child = Init.Child
let TextMapType = Prelude.Map.Type Text
let Children = TextMapType Child.Type
let wrapHarness
: Children → Child.Type
= λ(children : Children)
→ Child.nested
children
Child.Attributes::{
, binary = "sotest-harness"
, exitPropagate = True
, resources = Init.Resources::{ ram = Genode.units.MiB 4 }
, routes =
[ Init.ServiceRoute.parentLabel
"LOG"
(Some "SOTEST")
(Some "unlabeled")
, Init.ServiceRoute.parent "IO_MEM"
, Init.ServiceRoute.parent "IO_PORT"
, Init.ServiceRoute.parent "IRQ"
, Init.ServiceRoute.parent "VM"
, Init.ServiceRoute.child "Timer" "timer"
, Init.ServiceRoute.child "Rtc" "rtc"
]
}
in λ(test : Test.Type)
→ λ(inputsManifest : TextMapType (TextMapType Text))
→ Genode.Boot::{
, config = Init::{
, children =
[ { mapKey = "timer"
, mapValue =
Child.flat
Child.Attributes::{
, binary = "timer_drv"
, provides = [ "Timer" ]
}
}
, { mapKey = "rtc"
, mapValue =
Child.flat
Child.Attributes::{
, binary = "rtc_drv"
, provides = [ "Rtc" ]
, routes = [ Init.ServiceRoute.parent "IO_PORT" ]
}
}
, { mapKey = "harness", mapValue = wrapHarness test.children }
]
}
, rom =
test.rom
# Genode.BootModules.toRomPaths
( Prelude.List.concat
(Prelude.Map.Entry Text Text)
( Prelude.Map.values
Text
(Prelude.Map.Type Text Text)
inputsManifest
)
)
}