Fixed Windows builds, enhanced unit test framework with error messages upon exceptions.

This commit is contained in:
Matthias Koefferlein 2023-11-26 17:04:44 +01:00
parent cb1589b2ba
commit b7d1d22fb2
2 changed files with 3 additions and 1 deletions

View File

@ -684,7 +684,7 @@ struct writer<gsi::ObjectType>
try {
// Note: this const_cast is ugly, but it will basically enable "out" parameters
// TODO: clean this up.
gsi::do_on_type<writer> () (a->type (), &arglist, (arg->get_list ().begin () + narg).operator-> (), *a, heap);
gsi::do_on_type<writer> () (a->type (), &arglist, const_cast<tl::Variant *> ((arg->get_list ().begin () + narg).operator-> ()), *a, heap);
} catch (tl::Exception &ex) {
std::string msg = ex.msg () + tl::sprintf (tl::to_string (tr (" (argument '%s')")), a->spec ()->name ());
throw tl::Exception (msg);

View File

@ -267,6 +267,8 @@ bool TestBase::do_test (bool editable, bool slow)
try {
execute (this);
} catch (tl::CancelException &) {
throw;
} catch (tl::Exception &ex) {
raise (std::string ("Exception caught: ") + ex.msg ());
} catch (std::runtime_error &ex) {