#
# Build
#

set build_components {
	core init
	timer
	test/gtest-samples
}

build $build_components

create_boot_directory

#
# Generate config
#

install_config {
<config verbose="yes">
	<parent-provides>
		<service name="ROM"/>
		<service name="CAP"/>
		<service name="RM"/>
		<service name="PD"/>
		<service name="CPU"/>
		<service name="LOG"/>
		<service name="SIGNAL"/>
		<service name="IO_PORT"/>
	</parent-provides>
	<default-route>
		<any-service> <parent/> <any-child/> </any-service>
	</default-route>
	<default caps="100"/>

	<start name="timer">
		<resource name="RAM" quantum="1M"/>
		<provides> <service name="Timer"/> </provides>
	</start>

	<start name="gtest-samples">
		<resource name="RAM" quantum="4M"/>
		<config>
			<vfs>
				<dir name="dev"> <log/> <inline name="rtc">2018-01-01 00:01</inline> </dir>
			</vfs>
			<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc" />
		</config>
	</start>
</config>}

#
# Boot image
#

build_boot_image {
	core init ld.lib.so
	timer
	libc.lib.so vfs.lib.so libm.lib.so posix.lib.so stdcxx.lib.so
	gtest.lib.so gtest-samples
}

append qemu_args " -nographic "

run_genode_until {.*child "gtest-samples" exited with exit value 0} 1000
