From bfb8da32603b8f9ba753cc1052685ec57b8f7e2c Mon Sep 17 00:00:00 2001 From: dpranke Date: Tue, 21 Jul 2015 20:43:54 -0700 Subject: [PATCH] Add GN data/data_deps logic for some test binaries. This adds the data and data_deps logic for ui_base_unittests and cacheinvalidation_unittests for the GN build, so that we can run those two binaries under swarming. R=sky@chromium.org, brettw@chromium.org, maruel@chromium.org BUG=504079 Review URL: https://codereview.chromium.org/1246103005 Cr-Commit-Position: refs/heads/master@{#339829} --- testing/buildbot/chromium.linux.json | 6 +++++ third_party/cacheinvalidation/BUILD.gn | 9 +++++++ ui/base/BUILD.gn | 45 +++++++++++++++++++++++++++++++--- 3 files changed, 57 insertions(+), 3 deletions(-) diff --git a/testing/buildbot/chromium.linux.json b/testing/buildbot/chromium.linux.json index addfb0c24910..34fada06287f 100644 --- a/testing/buildbot/chromium.linux.json +++ b/testing/buildbot/chromium.linux.json @@ -256,6 +256,9 @@ "test": "base_unittests" }, { + "swarming": { + "can_use_on_swarming_builders": true + }, "test": "cacheinvalidation_unittests" }, { @@ -400,6 +403,9 @@ "test": "sync_unit_tests" }, { + "swarming": { + "can_use_on_swarming_builders": true + }, "test": "ui_base_unittests" }, { diff --git a/third_party/cacheinvalidation/BUILD.gn b/third_party/cacheinvalidation/BUILD.gn index 17e4d1c4a1af..5056841e90e1 100644 --- a/third_party/cacheinvalidation/BUILD.gn +++ b/third_party/cacheinvalidation/BUILD.gn @@ -90,6 +90,15 @@ static_library("cacheinvalidation") { ] } +# TODO(GYP): Delete this after we've converted everything to GN. +# The _run targets exist only for compatibility w/ GYP. +group("cacheinvalidation_unittests_run") { + testonly = true + deps = [ + ":cacheinvalidation_unittests", + ] +} + test("cacheinvalidation_unittests") { sources = [ "src/google/cacheinvalidation/impl/invalidation-client-impl_test.cc", diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn index 00ad6a4a3b82..824fe9ba075b 100644 --- a/ui/base/BUILD.gn +++ b/ui/base/BUILD.gn @@ -627,6 +627,16 @@ if (is_android) { } } +# +# TODO(GYP): Delete this after we've converted everything to GN. +# The _run targets exist only for compatibility w/ GYP. +group("ui_base_unittests_run") { + testonly = true + deps = [ + ":ui_base_unittests", + ] +} + # GYP version: ui/base/ui_base_tests.gyp:ui_base_unittests test("ui_base_unittests") { sources = [ @@ -648,6 +658,9 @@ test("ui_base_unittests") { "user_activity/user_activity_detector_unittest.cc", ] + data = [] + data_deps = [] + if (is_android) { sources -= [ "user_activity/user_activity_detector_unittest.cc" ] } @@ -784,9 +797,7 @@ test("ui_base_unittests") { "//ui/gfx/x", ] - datadeps = [ - "//tools/xdisplaycheck", - ] + data_deps += [ "//tools/xdisplaycheck" ] } if (is_mac) { @@ -818,5 +829,33 @@ test("ui_base_unittests") { "//ui/events:dom_keycode_converter", ] } + + if (is_linux || is_mac || is_win) { + # TODO(brettw): We should be able to depend on //ui/resources:ui_test_pak + # instead of depending directly on the non-test .pak files, but depending + # on ui_test_pak seems to have no effect. + data += [ + "test/data/data_pack_unittest/truncated-header.pak", + "$root_out_dir/ui_test.pak", # TODO(brettw): remove this line. + ] + data_deps += [ + "//ui/resources:ui_test_pak", # TODO(brettw): this does nothing. + "//third_party/mesa:osmesa", + ] + } + if (is_linux || is_win) { + data += [ + # TODO(brettw): Remove these two lines. + "$root_out_dir/ui/en-US.pak", + "$root_gen_dir/ui/resources/ui_resources_100_percent.pak", + ] + } + if (is_mac) { + data += [ "$root_out_dir/ui_unittests Framework.framework/" ] + + if (use_asan && symbol_level == 0) { + data += [ "$root_out_dir/ui_base_unittests.dSYM/" ] + } + } } # TODO(GYP) Mac (ui_base_tests_bundle) -- 2.11.4.GIT