Add component exit to tests

This makes it possible to detect successful test runs in a general way.
This commit is contained in:
Ehmry - 2020-01-14 11:02:55 +01:00
parent 6463f84741
commit c812fdf629
8 changed files with 10 additions and 2 deletions

View File

@ -83,7 +83,7 @@ struct Main
void call_const_method(Compound const &compound) { void call_const_method(Compound const &compound) {
compound.member->reference.const_method(); } compound.member->reference.const_method(); }
Main(Env &) Main(Env &env)
{ {
log("--- Reconstructible utility test ---"); log("--- Reconstructible utility test ---");
{ {
@ -132,6 +132,7 @@ struct Main
log("got exception, as expected"); } log("got exception, as expected"); }
log("--- Reconstructible utility test finished ---"); log("--- Reconstructible utility test finished ---");
env.parent().exit(0);
} }
}; };

View File

@ -41,12 +41,13 @@ struct Main
Adder adder { }; Adder adder { };
Synced_interface<Adder, Pseudo_lock> synced_adder { lock, &adder }; Synced_interface<Adder, Pseudo_lock> synced_adder { lock, &adder };
Main(Env &) Main(Env &env)
{ {
log("--- Synced interface test ---"); log("--- Synced interface test ---");
int const res = synced_adder()->add(13, 14); int const res = synced_adder()->add(13, 14);
log("result is ", res); log("result is ", res);
log("--- Synced interface test finished ---"); log("--- Synced interface test finished ---");
env.parent().exit(0);
} }
}; };

View File

@ -77,6 +77,7 @@ struct Main
test.construct(env, false, 1, "without timeouts"); test.destruct(); test.construct(env, false, 1, "without timeouts"); test.destruct();
test.construct(env, true, 2, "with timeouts"); test.destruct(); test.construct(env, true, 2, "with timeouts"); test.destruct();
log("--- Timed semaphore test finished ---"); log("--- Timed semaphore test finished ---");
env.parent().exit(0);
} }
}; };

View File

@ -143,6 +143,7 @@ struct Main
test_3.construct(env, 3); test_3.destruct(); test_3.construct(env, 3); test_3.destruct();
test_4.construct(env, 4); test_4.destruct(); test_4.construct(env, 4); test_4.destruct();
log("--- Framebuffer benchmark finished ---"); log("--- Framebuffer benchmark finished ---");
env.parent().exit(0);
} }
}; };

View File

@ -92,4 +92,5 @@ void Component::construct(Genode::Env &env)
pci.release_device(prev_device_cap); pci.release_device(prev_device_cap);
log("--- Platform test finished ---"); log("--- Platform test finished ---");
env.parent().exit(0);
} }

View File

@ -119,6 +119,7 @@ struct Main
} }
log("allocator: sum=", alloc.sum); log("allocator: sum=", alloc.sum);
log("--- RAM filesystem chunk test finished ---"); log("--- RAM filesystem chunk test finished ---");
env.parent().exit(0);
} }
void write(Chunk_level_0 &chunk, char const *str, off_t seek_offset) void write(Chunk_level_0 &chunk, char const *str, off_t seek_offset)

View File

@ -72,6 +72,7 @@ struct Main
src.release_packet(pkt); src.release_packet(pkt);
} }
log("--- ROM Block test finished ---"); log("--- ROM Block test finished ---");
env.parent().exit(0);
} }
}; };

View File

@ -693,6 +693,7 @@ struct Main
{ {
test_8.destruct(); test_8.destruct();
log("--- Signalling test finished ---"); log("--- Signalling test finished ---");
env.parent().exit(0);
} }
Main(Env &env) : env(env) Main(Env &env) : env(env)