Skip to content
Snippets Groups Projects
Commit cbe5155d authored by Sylvester Joosten's avatar Sylvester Joosten
Browse files

Updated benchmark output file to always write to a 'tests' key, making it...

Updated benchmark output file to always write to a 'tests' key, making it easier to detect if a json file contains test results
parent c265bf25
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !17. Comments created here will be created in the context of that merge request.
...@@ -98,17 +98,17 @@ private: ...@@ -98,17 +98,17 @@ private:
} }
}; };
void write_test(const std::vector<test>& data, const std::string& fname) { void write_test(const std::vector<Test>& data, const std::string& fname) {
nlohmann::json test; nlohmann::json test;
for (auto& entry : data) { for (auto& entry : data) {
test["test"].push_back(entry.json); test["tests"].push_back(entry.json);
} }
std::cout << fmt::format("Writing test data to {}\n", fname); std::cout << fmt::format("Writing test data to {}\n", fname);
std::ofstream output_file(fname); std::ofstream output_file(fname);
output_file << std::setw(4) << test << "\n"; output_file << std::setw(4) << test << "\n";
} }
void write_test(const test& data, const std::string& fname) { void write_test(const Test& data, const std::string& fname) {
std::vector<test> vtd{data}; std::vector<Test> vtd{data};
write_test(vtd, fname); write_test(vtd, fname);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment