From 32fa5104148722dbd6aac1ce8d38dcf47737f669 Mon Sep 17 00:00:00 2001 From: Ben Wagner Date: Thu, 10 Aug 2017 21:25:55 -0400 Subject: Abort dm/nanobench on bad configs. Adjust the configs specified by recipes to avoid the new error. Change-Id: I23e31355e2faaab919d92abdb37a6f70cd2da1ff Reviewed-on: https://skia-review.googlesource.com/32862 Reviewed-by: Brian Osman Commit-Queue: Ben Wagner --- dm/DM.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'dm/DM.cpp') diff --git a/dm/DM.cpp b/dm/DM.cpp index 11527bfdaf..6d35391de7 100644 --- a/dm/DM.cpp +++ b/dm/DM.cpp @@ -60,6 +60,7 @@ extern void SkPDFImageDumpStats(); extern bool gSkForceRasterPipelineBlitter; +DECLARE_bool(undefok); DEFINE_string(src, "tests gm skp image", "Source types to test."); DEFINE_bool(nameByHash, false, "If true, write to FLAGS_writePath[0]/.png instead of " @@ -979,9 +980,15 @@ static bool gather_sinks(const GrContextOptions& grCtxOptions) { } // If no configs were requested (just running tests, perhaps?), then we're okay. - // Otherwise, make sure that at least one sink was constructed correctly. This catches - // the case of bots without a GPU being assigned GPU configs. - return (configs.count() == 0) || (gSinks.count() > 0); + if (configs.count() == 0 || FLAGS_config.count() == 0 || + // If we've been told to ignore undefined flags, we're okay. + FLAGS_undefok || + // Otherwise, make sure that all specified configs have become sinks. + configs.count() == gSinks.count()) { + return true; + } + info("Invalid --config. Use --undefok to bypass this warning.\n"); + return false; } static bool dump_png(SkBitmap bitmap, const char* path, const char* md5) { -- cgit v1.2.3