From c265bf25843745210b275575f34eaffe67f17dd5 Mon Sep 17 00:00:00 2001
From: Sylvester Joosten <sjoosten@anl.gov>
Date: Tue, 22 Dec 2020 14:19:45 +0000
Subject: [PATCH] fixed mistake with capitalization update
---
util/benchmark.hh | 8 ++++----
util/collect_tests.py | 18 ++++++++++++++++++
2 files changed, 22 insertions(+), 4 deletions(-)
create mode 100644 util/collect_tests.py
diff --git a/util/benchmark.hh b/util/benchmark.hh
index c05954c1..f4ff6f99 100644
--- a/util/benchmark.hh
+++ b/util/benchmark.hh
@@ -49,9 +49,9 @@
// library
namespace eic::util {
-struct TestDefinitionError : exception {
+struct TestDefinitionError : Exception {
TestDefinitionError(std::string_view msg)
- : exception(msg, "test_definition_error") {}
+ : Exception(msg, "test_definition_error") {}
};
// Wrapper for our test data json, with three methods to set the status
@@ -68,7 +68,7 @@ struct TestDefinitionError : exception {
// - weight: Weight for this test (this is defaulted to 1.0 if not specified)
// - result: pass/fail/error
struct Test {
- test(nlohmann::json definition) : json{std::move(definition)} {
+ Test(nlohmann::json definition) : json{std::move(definition)} {
// initialize with error (as we don't have a value yet)
error();
// Check that all required fields are present
@@ -101,7 +101,7 @@ private:
void write_test(const std::vector<test>& data, const std::string& fname) {
nlohmann::json test;
for (auto& entry : data) {
- test.push_back(entry.json);
+ test["test"].push_back(entry.json);
}
std::cout << fmt::format("Writing test data to {}\n", fname);
std::ofstream output_file(fname);
diff --git a/util/collect_tests.py b/util/collect_tests.py
new file mode 100644
index 00000000..9e3d6e29
--- /dev/null
+++ b/util/collect_tests.py
@@ -0,0 +1,18 @@
+#!/usr/bin/env python3
+
+"""
+Collect the json files from individual benchmark tests into
+a larger json file that combines all benchmark information,
+and do additional accounting for the benchmark.
+
+Tests results are expected to have the following file name and directory
+structure:
+ results/<BENCHMARK_NAME>/<SOME_NAME>.json
+or
+ results/<BENCHMARK_NAME>/subdirectory/<SOME_NAME>.json
+
+Internally, we will look for the "tests" keyword in each of these
+files to identify them as benchmark components.
+"""
+
+
--
GitLab