HardwareState: EMMC data reader
Ported EMMC driver from
cla-sysrepo@19163e50ab062a8b5b75f754b30c22fdbd62b03a.
In cla-sysrepo, these drivers provided a property-based API, i.e., you
asked for a specific property (i.e., a filename) and the contents of the
file was returned.
In velia, we do not need this one-by-one property access. We provide all
attributes with a single call.
Change-Id: Icdb1129e84c2c7d8db50e192caa7c6ddce1441d7
diff --git a/tests/pretty_printers.h b/tests/pretty_printers.h
new file mode 100644
index 0000000..8fea584
--- /dev/null
+++ b/tests/pretty_printers.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2016-2018 CESNET, https://photonics.cesnet.cz/
+ *
+ * Written by Jan Kundrát <jan.kundrat@cesnet.cz>
+ *
+*/
+
+#pragma once
+
+#include <doctest/doctest.h>
+#include <map>
+#include <sstream>
+#include <trompeloeil.hpp>
+
+
+namespace doctest {
+
+template <>
+struct StringMaker<std::map<std::string, std::string>> {
+ static String convert(const std::map<std::string, std::string>& map)
+ {
+ std::ostringstream os;
+ os << "{" << std::endl;
+ for (const auto& [key, value] : map) {
+ os << " \"" << key << "\": \"" << value << "\"," << std::endl;
+ }
+ os << "}";
+ return os.str().c_str();
+ }
+};
+
+}