os/test: transition to new base API

For all tests
* use Component::construct instead of main
* use new connection constructors with env argument
* use log instead of printf

For some tests
* replace signal receivers with signal handlers
* replace global static variables with Main class members
* remove unnecessary multithreading
* model test steps as classes that are independent from each other and managed
  by Main as constructibles
* use references instead of pointers and exceptions instead of error codes
* use Attached_* helpers intead of doing attach/detach manually
* use helpers like String, Id_space, Registry instead of arrays and lists
* make the run script suitable for automated execution and conclusion

Ref #1987
This commit is contained in:
Martin Stein
2017-01-17 12:58:00 +01:00
committed by Norman Feske
parent e0fef69cb3
commit ad2d1fe586
31 changed files with 1159 additions and 1499 deletions

View File

@ -13,11 +13,11 @@
#include <base/component.h>
#include <base/env.h>
#include <base/log.h>
#include <base/printf.h>
#include <rtc_session/connection.h>
#include <timer_session/connection.h>
using namespace Genode;
struct Main
{
Main(Genode::Env &env)
@ -31,9 +31,8 @@ struct Main
for (unsigned i = 0; i < 4; ++i) {
Rtc::Timestamp now = rtc.current_time();
Genode::printf("RTC: %u-%02u-%02u %02u:%02u:%02u\n",
now.year, now.month, now.day,
now.hour, now.minute, now.second);
log("RTC: ", now.year, "-", now.month, "-", now.day, " ",
now.hour, ":", now.minute, ":", now.second);
timer.msleep(1000);
}