From 85d385a2ec9f6d365fee5a14fd2a5ea564ffb1a7 Mon Sep 17 00:00:00 2001 From: mathp Date: Fri, 18 Mar 2016 15:42:59 -0700 Subject: [PATCH] [libphonenumber] Run tests on swarming Also adding some files and their tests. BUG=585151 Review URL: https://codereview.chromium.org/1759723002 Cr-Commit-Position: refs/heads/master@{#382114} --- testing/buildbot/chromium.linux.json | 12 ++++++++++ testing/buildbot/chromium.mac.json | 12 ++++++++++ testing/buildbot/chromium.win.json | 12 ++++++++++ testing/buildbot/gn_isolate_map.pyl | 9 ++++--- third_party/libphonenumber/BUILD.gn | 12 +++++++++- third_party/libphonenumber/libphonenumber.gyp | 24 ++++++++++++++++++- .../libphonenumber_unittests.isolate | 20 ++++++++++++++++ 7 files changed, 94 insertions(+), 7 deletions(-) create mode 100644 third_party/libphonenumber/libphonenumber_unittests.isolate diff --git a/testing/buildbot/chromium.linux.json b/testing/buildbot/chromium.linux.json index 8f9d3e864b8710..d851938abd78c2 100644 --- a/testing/buildbot/chromium.linux.json +++ b/testing/buildbot/chromium.linux.json @@ -769,6 +769,12 @@ }, "test": "jingle_unittests" }, + { + "swarming": { + "can_use_on_swarming_builders": true + }, + "test": "libphonenumber_unittests" + }, { "test": "mash_unittests" }, @@ -1201,6 +1207,12 @@ }, "test": "jingle_unittests" }, + { + "swarming": { + "can_use_on_swarming_builders": true + }, + "test": "libphonenumber_unittests" + }, { "swarming": { "can_use_on_swarming_builders": true diff --git a/testing/buildbot/chromium.mac.json b/testing/buildbot/chromium.mac.json index 9b29c59c930d25..8df26a9316d171 100644 --- a/testing/buildbot/chromium.mac.json +++ b/testing/buildbot/chromium.mac.json @@ -199,6 +199,12 @@ }, "test": "jingle_unittests" }, + { + "swarming": { + "can_use_on_swarming_builders": true + }, + "test": "libphonenumber_unittests" + }, { "swarming": { "can_use_on_swarming_builders": true @@ -1148,6 +1154,12 @@ }, "test": "jingle_unittests" }, + { + "swarming": { + "can_use_on_swarming_builders": true + }, + "test": "libphonenumber_unittests" + }, { "swarming": { "can_use_on_swarming_builders": true diff --git a/testing/buildbot/chromium.win.json b/testing/buildbot/chromium.win.json index 546528170baba3..2bdafb8dbfbf52 100644 --- a/testing/buildbot/chromium.win.json +++ b/testing/buildbot/chromium.win.json @@ -210,6 +210,12 @@ { "test": "keyboard_unittests" }, + { + "swarming": { + "can_use_on_swarming_builders": true + }, + "test": "libphonenumber_unittests" + }, { "swarming": { "can_use_on_swarming_builders": true @@ -1432,6 +1438,12 @@ }, "test": "jingle_unittests" }, + { + "swarming": { + "can_use_on_swarming_builders": true + }, + "test": "libphonenumber_unittests" + }, { "swarming": { "can_use_on_swarming_builders": true diff --git a/testing/buildbot/gn_isolate_map.pyl b/testing/buildbot/gn_isolate_map.pyl index efe5c9d1bd01b5..02cc65e94b9992 100644 --- a/testing/buildbot/gn_isolate_map.pyl +++ b/testing/buildbot/gn_isolate_map.pyl @@ -324,11 +324,10 @@ #"label": "//third_party/libaddressinput:libaddressinput_unittests", #"type": "console_test_launcher", #}, - # See http://crbug.com/585151 - #"libphonenumber_unittests": { - #"label": "//third_party/libphonenumber:libphonenumber_unittests", - #"type": "console_test_launcher", - #}, + "libphonenumber_unittests": { + "label": "//third_party/libphonenumber:libphonenumber_unittests", + "type": "console_test_launcher", + }, "media_unittests": { "label": "//media:media_unittests", "type": "windowed_test_launcher", diff --git a/third_party/libphonenumber/BUILD.gn b/third_party/libphonenumber/BUILD.gn index 0e979c0e74a647..de30e815d6e48d 100644 --- a/third_party/libphonenumber/BUILD.gn +++ b/third_party/libphonenumber/BUILD.gn @@ -18,7 +18,10 @@ config("libphonenumber_config") { "dist/cpp/src", "$root_gen_dir/third_party/libphonenumber", ] - defines = [ "I18N_PHONENUMBERS_USE_ICU_REGEXP=1" ] + defines = [ + "I18N_PHONENUMBERS_USE_ALTERNATE_FORMATS=1", + "I18N_PHONENUMBERS_USE_ICU_REGEXP=1", + ] if (!is_android) { defines += [ "I18N_PHONENUMBERS_NO_THREAD_SAFETY=1" ] } @@ -36,6 +39,7 @@ config("libphonenumber_config_internal") { # GYP version: third_party/libphonenumber/libphonenumber.gyp:libphonenumber_without_metadata static_library("libphonenumber_without_metadata") { sources = [ + "dist/cpp/src/phonenumbers/alternate_format.cc", "dist/cpp/src/phonenumbers/asyoutypeformatter.cc", "dist/cpp/src/phonenumbers/base/strings/string_piece.cc", "dist/cpp/src/phonenumbers/default_logger.cc", @@ -99,15 +103,21 @@ test("libphonenumber_unittests") { "dist/cpp/test/phonenumbers/phonenumbermatcher_test.cc", "dist/cpp/test/phonenumbers/phonenumberutil_test.cc", "dist/cpp/test/phonenumbers/regexp_adapter_test.cc", + "dist/cpp/test/phonenumbers/regexp_cache_test.cc", "dist/cpp/test/phonenumbers/stringutil_test.cc", "dist/cpp/test/phonenumbers/test_util.cc", "dist/cpp/test/phonenumbers/unicodestring_test.cc", + "dist/cpp/test/phonenumbers/utf/unicodetext_test.cc", ] configs += [ ":libphonenumber_config_internal" ] include_dirs = [ "dist/cpp/test" ] + data = [ + "dist/resources/test/", + ] + deps = [ ":libphonenumber_without_metadata", "//base", diff --git a/third_party/libphonenumber/libphonenumber.gyp b/third_party/libphonenumber/libphonenumber.gyp index e89f48e26d5083..4167712b98157a 100644 --- a/third_party/libphonenumber/libphonenumber.gyp +++ b/third_party/libphonenumber/libphonenumber.gyp @@ -128,9 +128,11 @@ 'dist/cpp/test/phonenumbers/phonenumbermatcher_test.cc', 'dist/cpp/test/phonenumbers/phonenumberutil_test.cc', 'dist/cpp/test/phonenumbers/regexp_adapter_test.cc', + 'dist/cpp/test/phonenumbers/regexp_cache_test.cc', 'dist/cpp/test/phonenumbers/stringutil_test.cc', 'dist/cpp/test/phonenumbers/test_util.cc', 'dist/cpp/test/phonenumbers/unicodestring_test.cc', + 'dist/cpp/test/phonenumbers/utf/unicodetext_test.cc', ], 'dependencies': [ '../icu/icu.gyp:icui18n', @@ -160,5 +162,25 @@ ], }], ], - }] + }], + 'conditions': [ + ['test_isolation_mode != "noop"', { + 'targets': [ + { + 'target_name': 'libphonenumber_unittests_run', + 'type': 'none', + 'dependencies': [ + 'libphonenumber_unittests', + ], + 'includes': [ + '../../build/isolate.gypi', + ], + 'sources': [ + 'libphonenumber_unittests.isolate', + ], + }, + ], + }, { + }], + ], } diff --git a/third_party/libphonenumber/libphonenumber_unittests.isolate b/third_party/libphonenumber/libphonenumber_unittests.isolate new file mode 100644 index 00000000000000..8785ff3479684c --- /dev/null +++ b/third_party/libphonenumber/libphonenumber_unittests.isolate @@ -0,0 +1,20 @@ +# Copyright (c) 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +{ + 'conditions': [ + ['OS=="linux" or OS=="mac" or OS=="win"', { + 'variables': { + 'command': [ + '<(PRODUCT_DIR)/libphonenumber_unittests<(EXECUTABLE_SUFFIX)', + ], + 'files': [ + 'dist/resources/test/', + ], + }, + }], + ], + 'includes': [ + '../../base/base.isolate', + ], +} \ No newline at end of file