add tests for quest indexes and function compiler

This commit is contained in:
Martin Michelsen
2025-10-21 22:52:35 -07:00
parent 790363adb5
commit be4c7f80cb
11 changed files with 66 additions and 17 deletions
+8 -1
View File
@@ -436,7 +436,8 @@ QuestIndex::QuestIndex(
const string& directory,
shared_ptr<const QuestCategoryIndex> category_index,
const unordered_map<string, shared_ptr<const CommonItemSet>>& common_item_sets,
const unordered_map<string, shared_ptr<const RareItemSet>>& rare_item_sets)
const unordered_map<string, shared_ptr<const RareItemSet>>& rare_item_sets,
bool raise_on_any_failure)
: directory(directory),
category_index(category_index) {
@@ -585,6 +586,9 @@ QuestIndex::QuestIndex(
}
} catch (const exception& e) {
if (raise_on_any_failure) {
throw runtime_error(format("({}) {}", filename, e.what()));
}
static_game_data_log.warning_f("({}) Failed to load quest file: ({})", filename, e.what());
}
}
@@ -803,6 +807,9 @@ QuestIndex::QuestIndex(
vq->meta.joinable ? "joinable" : "not joinable");
}
} catch (const exception& e) {
if (raise_on_any_failure) {
throw runtime_error(format("({}) {}", basename, e.what()));
}
static_game_data_log.warning_f("({}) Failed to index quest file: {}", basename, e.what());
}
}