mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-18 10:46:25 +00:00
run/timeout: run also on arm w/o hw and qemu
On platforms were we do not have local time interpolation we can simply skip the first test stage in the timeout test. This way, we can at least test the rest. Fixes #2435
This commit is contained in:
parent
685f509a43
commit
23337eb6e7
@ -3,24 +3,18 @@
|
||||
#
|
||||
|
||||
#
|
||||
# Do not run on QEMU as its time emulation is not precise enough
|
||||
# Do not high precision time on ARM with kernels other than HW and on QEMU
|
||||
#
|
||||
if {[get_cmd_switch --autopilot] && [have_include "power_on/qemu"]} {
|
||||
puts "\nRunning timeout test in autopilot on Qemu is not recommended.\n"
|
||||
exit 0
|
||||
}
|
||||
|
||||
# On ARM, we do not have a component-local hardware time-source. The ARM
|
||||
# performance counter has no reliable frequency as the ARM idle command
|
||||
# halts the counter. Thus, we do not do local time interpolation on ARM.
|
||||
# Except we're on the HW kernel. In this case we can read out the kernel
|
||||
# time instead. On QEMU, the time emulation is not precise enough.
|
||||
#
|
||||
# Do not run on ARM with kernels other than HW
|
||||
#
|
||||
# The ARM performance counter has no reliable frequency as the ARM idle command
|
||||
# (often called on idle) halts the counter. Only on the HW kernel we have a syscall
|
||||
# that enables us to avoid the use of the performance counter by reading the kernel
|
||||
# time instead.
|
||||
#
|
||||
if {[expr [have_spec arm] && ![have_spec hw]]} {
|
||||
puts "\n Run script is not supported on this platform.\n";
|
||||
exit 0
|
||||
proc high_precision_time { } {
|
||||
if {[get_cmd_switch --autopilot] && [have_include "power_on/qemu"]} { return false }
|
||||
if {[expr [have_spec arm] && ![have_spec hw]]} { return false }
|
||||
return true
|
||||
}
|
||||
|
||||
build "core init drivers/platform drivers/timer test/timeout test/cpufreq"
|
||||
@ -31,7 +25,7 @@ build "core init drivers/platform drivers/timer test/timeout test/cpufreq"
|
||||
|
||||
create_boot_directory
|
||||
|
||||
install_config {
|
||||
append config {
|
||||
<config>
|
||||
<parent-provides>
|
||||
<service name="ROM"/>
|
||||
@ -54,10 +48,13 @@ install_config {
|
||||
<start name="test">
|
||||
<binary name="test-timeout"/>
|
||||
<resource name="RAM" quantum="250M"/>
|
||||
<config high_precision_time="} [high_precision_time] {"/>
|
||||
</start>
|
||||
</config>
|
||||
}
|
||||
|
||||
install_config $config
|
||||
|
||||
build_boot_image "core ld.lib.so init timer test-timeout"
|
||||
|
||||
#
|
||||
|
@ -17,18 +17,20 @@
|
||||
#include <timer_session/connection.h>
|
||||
#include <util/fifo.h>
|
||||
#include <util/misc_math.h>
|
||||
#include <base/attached_rom_dataspace.h>
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
|
||||
struct Test
|
||||
{
|
||||
Env &env;
|
||||
unsigned &error_cnt;
|
||||
Signal_transmitter done;
|
||||
unsigned id;
|
||||
Timer::Connection timer_connection { env };
|
||||
Timer::Connection timer { env };
|
||||
Env &env;
|
||||
unsigned &error_cnt;
|
||||
Signal_transmitter done;
|
||||
unsigned id;
|
||||
Timer::Connection timer_connection { env };
|
||||
Timer::Connection timer { env };
|
||||
Attached_rom_dataspace config { env, "config" };
|
||||
|
||||
Test(Env &env,
|
||||
unsigned &error_cnt,
|
||||
@ -525,7 +527,12 @@ struct Fast_polling : Test
|
||||
main_ep(env, STACK_SIZE, "fast_polling_ep"),
|
||||
main_handler(main_ep, *this, &Fast_polling::main)
|
||||
{
|
||||
Signal_transmitter(main_handler).submit();
|
||||
if (config.xml().attribute_value("high_precision_time", true)) {
|
||||
Signal_transmitter(main_handler).submit();
|
||||
} else {
|
||||
log("... skip test because it requires high precision time");
|
||||
Test::done.submit();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user