Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Side by Side Diff: dm/DM.cpp

Issue 1957273002: Make DM fail if no configs were successfully created (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Spelling error Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 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 "CrashHandler.h" 8 #include "CrashHandler.h"
9 #include "DMJsonWriter.h" 9 #include "DMJsonWriter.h"
10 #include "DMSrcSink.h" 10 #include "DMSrcSink.h"
(...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 } 916 }
917 917
918 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK 918 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
919 VIA("androidsdk", ViaAndroidSDK, wrapped); 919 VIA("androidsdk", ViaAndroidSDK, wrapped);
920 #endif 920 #endif
921 921
922 #undef VIA 922 #undef VIA
923 return nullptr; 923 return nullptr;
924 } 924 }
925 925
926 static void gather_sinks() { 926 static bool gather_sinks() {
927 SkCommandLineConfigArray configs; 927 SkCommandLineConfigArray configs;
928 ParseConfigs(FLAGS_config, &configs); 928 ParseConfigs(FLAGS_config, &configs);
929 for (int i = 0; i < configs.count(); i++) { 929 for (int i = 0; i < configs.count(); i++) {
930 const SkCommandLineConfig& config = *configs[i]; 930 const SkCommandLineConfig& config = *configs[i];
931 Sink* sink = create_sink(&config); 931 Sink* sink = create_sink(&config);
932 if (sink == nullptr) { 932 if (sink == nullptr) {
933 info("Skipping config %s: Don't understand '%s'.\n", config.getTag() .c_str(), 933 info("Skipping config %s: Don't understand '%s'.\n", config.getTag() .c_str(),
934 config.getTag().c_str()); 934 config.getTag().c_str());
935 continue; 935 continue;
936 } 936 }
937 937
938 const SkTArray<SkString>& parts = config.getViaParts(); 938 const SkTArray<SkString>& parts = config.getViaParts();
939 for (int j = parts.count(); j-- > 0;) { 939 for (int j = parts.count(); j-- > 0;) {
940 const SkString& part = parts[j]; 940 const SkString& part = parts[j];
941 Sink* next = create_via(part, sink); 941 Sink* next = create_via(part, sink);
942 if (next == nullptr) { 942 if (next == nullptr) {
943 info("Skipping config %s: Don't understand '%s'.\n", config.getT ag().c_str(), 943 info("Skipping config %s: Don't understand '%s'.\n", config.getT ag().c_str(),
944 part.c_str()); 944 part.c_str());
945 delete sink; 945 delete sink;
946 sink = nullptr; 946 sink = nullptr;
947 break; 947 break;
948 } 948 }
949 sink = next; 949 sink = next;
950 } 950 }
951 if (sink) { 951 if (sink) {
952 push_sink(config, sink); 952 push_sink(config, sink);
953 } 953 }
954 } 954 }
955
956 // If no configs were requested (just running tests, perhaps?), then we're o kay.
957 // Otherwise, make sure that at least one sink was constructed correctly. Th is catches
958 // the case of bots without a GPU being assigned GPU configs.
959 return (configs.count() == 0) || (gSinks.count() > 0);
955 } 960 }
956 961
957 static bool dump_png(SkBitmap bitmap, const char* path, const char* md5) { 962 static bool dump_png(SkBitmap bitmap, const char* path, const char* md5) {
958 const int w = bitmap.width(), 963 const int w = bitmap.width(),
959 h = bitmap.height(); 964 h = bitmap.height();
960 965
961 sk_sp<SkData> encodedBitmap = sk_tools::encode_bitmap_for_png(bitmap); 966 sk_sp<SkData> encodedBitmap = sk_tools::encode_bitmap_for_png(bitmap);
962 if (encodedBitmap.get() == nullptr) { 967 if (encodedBitmap.get() == nullptr) {
963 return false; 968 return false;
964 } 969 }
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
1316 if (!testResource.isValid()) { 1321 if (!testResource.isValid()) {
1317 info("Some resources are missing. Do you need to set --resourcePath ?\n"); 1322 info("Some resources are missing. Do you need to set --resourcePath ?\n");
1318 } 1323 }
1319 } 1324 }
1320 gather_gold(); 1325 gather_gold();
1321 gather_uninteresting_hashes(); 1326 gather_uninteresting_hashes();
1322 1327
1323 if (!gather_srcs()) { 1328 if (!gather_srcs()) {
1324 return 1; 1329 return 1;
1325 } 1330 }
1326 gather_sinks(); 1331 if (!gather_sinks()) {
1332 return 1;
1333 }
1327 gather_tests(); 1334 gather_tests();
1328 gPending = gSrcs.count() * gSinks.count() + gParallelTests.count() + gSerial Tests.count(); 1335 gPending = gSrcs.count() * gSinks.count() + gParallelTests.count() + gSerial Tests.count();
1329 info("%d srcs * %d sinks + %d tests == %d tasks", 1336 info("%d srcs * %d sinks + %d tests == %d tasks",
1330 gSrcs.count(), gSinks.count(), gParallelTests.count() + gSerialTests.co unt(), gPending); 1337 gSrcs.count(), gSinks.count(), gParallelTests.count() + gSerialTests.co unt(), gPending);
1331 SkAutoTDelete<SkThread> statusThread(start_status_thread()); 1338 SkAutoTDelete<SkThread> statusThread(start_status_thread());
1332 1339
1333 // Kick off as much parallel work as we can, making note of any serial work we'll need to do. 1340 // Kick off as much parallel work as we can, making note of any serial work we'll need to do.
1334 SkTaskGroup parallel; 1341 SkTaskGroup parallel;
1335 SkTArray<Task> serial; 1342 SkTArray<Task> serial;
1336 1343
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
1443 #endif 1450 #endif
1444 } 1451 }
1445 } // namespace skiatest 1452 } // namespace skiatest
1446 1453
1447 #if !defined(SK_BUILD_FOR_IOS) 1454 #if !defined(SK_BUILD_FOR_IOS)
1448 int main(int argc, char** argv) { 1455 int main(int argc, char** argv) {
1449 SkCommandLineFlags::Parse(argc, argv); 1456 SkCommandLineFlags::Parse(argc, argv);
1450 return dm_main(); 1457 return dm_main();
1451 } 1458 }
1452 #endif 1459 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698