From de8362c6f212b42b03de66a58df29272cb3081be Mon Sep 17 00:00:00 2001 From: Mike Klein Date: Tue, 9 Apr 2019 11:14:04 -0500 Subject: [PATCH] remove DMJsonWriter::AddTestFailure As far as I can tell, Gold doesn't do anything with this information. The bots go red if any unit test fails... no need to log it long-term. Change-Id: Iae9ddd61c0a7d37437bb93441e83948c2e518b42 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206940 Reviewed-by: Brian Osman Commit-Queue: Mike Klein --- dm/DM.cpp | 1 - dm/DMJsonWriter.cpp | 26 -------------------------- dm/DMJsonWriter.h | 6 ------ 3 files changed, 33 deletions(-) diff --git a/dm/DM.cpp b/dm/DM.cpp index bdf9f6e139..24a2ef4130 100644 --- a/dm/DM.cpp +++ b/dm/DM.cpp @@ -1382,7 +1382,6 @@ static void run_test(skiatest::Test test, const GrContextOptions& grCtxOptions) struct : public skiatest::Reporter { void reportFailed(const skiatest::Failure& failure) override { fail(failure.toString()); - JsonWriter::AddTestFailure(failure); } bool allowExtendedTest() const override { return FLAGS_pathOpsExtended; diff --git a/dm/DMJsonWriter.cpp b/dm/DMJsonWriter.cpp index 3c6c42ef55..18796668bc 100644 --- a/dm/DMJsonWriter.cpp +++ b/dm/DMJsonWriter.cpp @@ -27,14 +27,6 @@ void JsonWriter::AddBitmapResult(const BitmapResult& result) { gBitmapResults.push_back(result); } -SkTArray gFailures; -SK_DECLARE_STATIC_MUTEX(gFailureLock); - -void JsonWriter::AddTestFailure(const skiatest::Failure& failure) { - SkAutoMutexAcquire lock(gFailureLock); - gFailures.push_back(failure); -} - void JsonWriter::DumpJson(const char* dir, CommandLineFlags::StringArray key, CommandLineFlags::StringArray properties) { @@ -98,24 +90,6 @@ void JsonWriter::DumpJson(const char* dir, writer.endArray(); // results } - { - SkAutoMutexAcquire lock(gFailureLock); - if (gFailures.count() > 0) { - writer.beginObject("test_results"); - writer.beginArray("failures"); - for (int i = 0; i < gFailures.count(); i++) { - writer.beginObject(); - writer.appendString("file_name", gFailures[i].fileName); - writer.appendS32 ("line_no" , gFailures[i].lineNo); - writer.appendString("condition", gFailures[i].condition); - writer.appendString("message" , gFailures[i].message.c_str()); - writer.endObject(); // 1 failure - } - writer.endArray(); // failures - writer.endObject(); // test_results - } - } - writer.endObject(); // root writer.flush(); stream.flush(); diff --git a/dm/DMJsonWriter.h b/dm/DMJsonWriter.h index 1248c5950e..c8cd3fc6ca 100644 --- a/dm/DMJsonWriter.h +++ b/dm/DMJsonWriter.h @@ -10,7 +10,6 @@ #include "CommandLineFlags.h" #include "SkString.h" -#include "Test.h" namespace DM { @@ -42,11 +41,6 @@ public: */ static void AddBitmapResult(const BitmapResult&); - /** - * Add a Failure from a Test. - */ - static void AddTestFailure(const skiatest::Failure&); - /** * Write all collected results to the file dir/dm.json. */