Skip to content

Commit

Permalink
fixture.cpp: provide better error message in SettingsBuild::library()
Browse files Browse the repository at this point in the history
  • Loading branch information
firewave committed Oct 1, 2024
1 parent 61e4409 commit fc8aa94
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/fixture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,9 @@ TestFixture::SettingsBuilder& TestFixture::SettingsBuilder::library(const char l
if (REDUNDANT_CHECK && std::find(settings.libraries.cbegin(), settings.libraries.cend(), lib) != settings.libraries.cend())
throw std::runtime_error("redundant setting: libraries (" + std::string(lib) + ")");
// TODO: exename is not yet set
if (settings.library.load(fixture.exename.c_str(), lib).errorcode != Library::ErrorCode::OK)
throw std::runtime_error("library '" + std::string(lib) + "' not found");
const Library::ErrorCode lib_error = settings.library.load(fixture.exename.c_str(), lib).errorcode;
if (lib_error != Library::ErrorCode::OK)
throw std::runtime_error("loading library '" + std::string(lib) + "' failed - " + std::to_string(static_cast<int>(lib_error)));
// strip extension
std::string lib_s(lib);
const std::string ext(".cfg");
Expand Down

0 comments on commit fc8aa94

Please sign in to comment.