#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "testing/perf/luci_test_result.h"
#include <utility>
#include "base/check.h"
#include "base/files/file_util.h"
#include "base/i18n/time_formatting.h"
#include "base/json/json_writer.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/values.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace perf_test {
namespace {
constexpr char kKeyFilePath[] = …;
constexpr char kKeyContents[] = …;
constexpr char kKeyContentType[] = …;
constexpr char kKeyTestResult[] = …;
constexpr char kKeyTestPath[] = …;
constexpr char kKeyVariant[] = …;
constexpr char kKeyStatus[] = …;
constexpr char kKeyExpected[] = …;
constexpr char kKeyStartTime[] = …;
constexpr char kKeyRunDuration[] = …;
constexpr char kKeyOutputArtifacts[] = …;
constexpr char kKeyTags[] = …;
constexpr char kKeyKey[] = …;
constexpr char kKeyValue[] = …;
std::string ToString(LuciTestResult::Status status) { … }
base::Value ToValue(const LuciTestResult::Artifact& artifact) { … }
base::Value ToValue(const LuciTestResult& result) { … }
std::string ToJson(const LuciTestResult& result) { … }
}
LuciTestResult::Artifact::Artifact() = default;
LuciTestResult::Artifact::Artifact(const Artifact& other) = default;
LuciTestResult::Artifact::Artifact(const base::FilePath file_path,
const std::string& content_type)
: … { … }
LuciTestResult::Artifact::Artifact(const std::string& contents,
const std::string& content_type)
: … { … }
LuciTestResult::Artifact::~Artifact() = default;
LuciTestResult::LuciTestResult() = default;
LuciTestResult::LuciTestResult(const LuciTestResult& other) = default;
LuciTestResult::LuciTestResult(LuciTestResult&& other) = default;
LuciTestResult::~LuciTestResult() = default;
LuciTestResult LuciTestResult::CreateForGTest() { … }
void LuciTestResult::AddVariant(const std::string& key,
const std::string& value) { … }
void LuciTestResult::AddOutputArtifactFile(const std::string& artifact_name,
const base::FilePath& file_path,
const std::string& content_type) { … }
void LuciTestResult::AddOutputArtifactContents(
const std::string& artifact_name,
const std::string& contents,
const std::string& content_type) { … }
void LuciTestResult::AddTag(const std::string& key, const std::string& value) { … }
void LuciTestResult::WriteToFile(const base::FilePath& result_file) const { … }
}