| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "DMJsonWriter.h" | 8 #include "DMJsonWriter.h" |
| 9 | 9 |
| 10 #include "SkCommonFlags.h" | 10 #include "SkCommonFlags.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 for (int i = 1; i < FLAGS_key.count(); i += 2) { | 45 for (int i = 1; i < FLAGS_key.count(); i += 2) { |
| 46 root["key"][FLAGS_key[i-1]] = FLAGS_key[i]; | 46 root["key"][FLAGS_key[i-1]] = FLAGS_key[i]; |
| 47 } | 47 } |
| 48 | 48 |
| 49 { | 49 { |
| 50 SkAutoMutexAcquire lock(&gBitmapResultLock); | 50 SkAutoMutexAcquire lock(&gBitmapResultLock); |
| 51 for (int i = 0; i < gBitmapResults.count(); i++) { | 51 for (int i = 0; i < gBitmapResults.count(); i++) { |
| 52 Json::Value result; | 52 Json::Value result; |
| 53 result["key"]["name"] = gBitmapResults[i].name.c_str(); | 53 result["key"]["name"] = gBitmapResults[i].name.c_str(); |
| 54 result["key"]["config"] = gBitmapResults[i].config.c_str(); | 54 result["key"]["config"] = gBitmapResults[i].config.c_str(); |
| 55 result["key"]["mode"] = gBitmapResults[i].mode.c_str(); | |
| 56 result["key"]["source_type"] = gBitmapResults[i].sourceType.c_str(); | 55 result["key"]["source_type"] = gBitmapResults[i].sourceType.c_str(); |
| 56 result["ext"] = gBitmapResults[i].ext.c_str(); |
| 57 result["md5"] = gBitmapResults[i].md5.c_str(); | 57 result["md5"] = gBitmapResults[i].md5.c_str(); |
| 58 | 58 |
| 59 root["results"].append(result); | 59 root["results"].append(result); |
| 60 } | 60 } |
| 61 } | 61 } |
| 62 | 62 |
| 63 { | 63 { |
| 64 SkAutoMutexAcquire lock(gFailureLock); | 64 SkAutoMutexAcquire lock(gFailureLock); |
| 65 for (int i = 0; i < gFailures.count(); i++) { | 65 for (int i = 0; i < gFailures.count(); i++) { |
| 66 Json::Value result; | 66 Json::Value result; |
| 67 result["file_name"] = gFailures[i].fileName; | 67 result["file_name"] = gFailures[i].fileName; |
| 68 result["line_no"] = gFailures[i].lineNo; | 68 result["line_no"] = gFailures[i].lineNo; |
| 69 result["condition"] = gFailures[i].condition; | 69 result["condition"] = gFailures[i].condition; |
| 70 result["message"] = gFailures[i].message.c_str(); | 70 result["message"] = gFailures[i].message.c_str(); |
| 71 | 71 |
| 72 root["test_results"]["failures"].append(result); | 72 root["test_results"]["failures"].append(result); |
| 73 } | 73 } |
| 74 } | 74 } |
| 75 | 75 |
| 76 SkString path = SkOSPath::Join(FLAGS_writePath[0], "dm.json"); | 76 SkString path = SkOSPath::Join(FLAGS_writePath[0], "dm.json"); |
| 77 SkFILEWStream stream(path.c_str()); | 77 SkFILEWStream stream(path.c_str()); |
| 78 stream.writeText(Json::StyledWriter().write(root).c_str()); | 78 stream.writeText(Json::StyledWriter().write(root).c_str()); |
| 79 stream.flush(); | 79 stream.flush(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 } // namespace DM | 82 } // namespace DM |
| OLD | NEW |