Merge branch 'master' into issue/2996

This commit is contained in:
Ylva Selling
2024-04-08 13:24:36 +02:00
236 changed files with 2888 additions and 2614 deletions
+1 -3
View File
@@ -610,12 +610,10 @@ void DocumentationEngine::writeDocumentation() const {
ZoneScoped;
// Write documentation to json files if config file supplies path for doc files
std::string path = global::configuration->documentation.path;
if (path.empty()) {
if (global::configuration->documentation.path.empty()) {
// if path was empty, that means that no documentation is requested
return;
}
path = absPath(path).string() + '/';
// Start the async requests as soon as possible so they are finished when we need them
std::future<nlohmann::json> settings = std::async(
+16 -3
View File
@@ -612,8 +612,10 @@ TestResult TemplateVerifier<glm::ivec4>::operator()(const ghoul::Dictionary& dic
}
}
TableVerifier::TableVerifier(std::vector<DocumentationEntry> documentationEntries)
TableVerifier::TableVerifier(std::vector<DocumentationEntry> documentationEntries,
std::optional<int> nEntries)
: documentations(std::move(documentationEntries))
, count(nEntries)
{}
TestResult TableVerifier::operator()(const ghoul::Dictionary& dictionary,
@@ -625,8 +627,8 @@ TestResult TableVerifier::operator()(const ghoul::Dictionary& dictionary,
TestResult res = testSpecification(doc, d);
// Add the 'key' as a prefix to make the new offender a fully qualified identifer
for (TestResult::Offense& s : res.offenses) {
s.offender = std::format("{}.{}", key, s.offender);
for (TestResult::Offense& o : res.offenses) {
o.offender = std::format("{}.{}", key, o.offender);
}
// Add the 'key' as a prefix to make the new warning a fully qualified identifer
@@ -634,6 +636,17 @@ TestResult TableVerifier::operator()(const ghoul::Dictionary& dictionary,
w.offender = std::format("{}.{}", key, w.offender);
}
if (count.has_value()) {
if (d.size() != *count) {
res.success = false;
res.offenses.emplace_back(
"Count",
TestResult::Offense::Reason::Verification,
std::format("Expected {} entries, but only got {}", *count, d.size())
);
}
}
return res;
}
else {