diff --git a/.gitignore b/.gitignore index f4745c353..fc5b66329 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *.pyc .gn pin-log.txt +base build buildtools chromium/.gclient.tmp @@ -21,6 +22,7 @@ tools/generate_library_loader tools/gn tools/grit tools/gyp +tools/isolate_driver.py tools/memory tools/protoc_wrapper tools/python diff --git a/DEPS b/DEPS index 6e29b68ee..b62124629 100644 --- a/DEPS +++ b/DEPS @@ -6,7 +6,7 @@ vars = { # Roll the Chromium Git hash to pick up newer versions of all the # dependencies and tools linked to in setup_links.py. - 'chromium_revision': 'bfea27af55be979d8146ed4d225f07a9cf1fba8b', # 7.27.2015 + 'chromium_revision': 'bb79186c63ff4eff7a2a318a21731005c53f269b', } hooks = [ diff --git a/libyuv_test.gyp b/libyuv_test.gyp index fad36debd..fd4a98b25 100644 --- a/libyuv_test.gyp +++ b/libyuv_test.gyp @@ -14,12 +14,10 @@ 'targets': [ { 'target_name': 'libyuv_unittest', - 'type': 'executable', + 'type': '<(gtest_target_type)', 'dependencies': [ 'libyuv.gyp:libyuv', - # The tests are based on gtest 'testing/gtest.gyp:gtest', - 'testing/gtest.gyp:gtest_main', ], 'defines': [ # Enable the following 3 macros to turn off assembly for specified CPU. @@ -77,6 +75,11 @@ 'HAVE_JPEG', ], }], + ['OS=="android"', { + 'dependencies': [ + '<(DEPTH)/testing/android/native_test.gyp:native_test_native_code', + ], + }], # TODO(YangZhang): These lines can be removed when high accuracy # YUV to RGB to Neon is ported. [ '(target_arch == "armv7" or target_arch == "armv7s" \ @@ -166,6 +169,40 @@ ], }, ], # targets + 'conditions': [ + ['OS=="android"', { + 'targets': [ + { + # TODO(kjellander): Figure out what to change in build/apk_test.gypi + # to it can be used instead of the copied code below. Using it in its + # current version was not possible, since the target starts with 'lib', + # which somewhere confuses the variables. + 'target_name': 'libyuv_unittest_apk', + 'type': 'none', + 'variables': { + # These are used to configure java_apk.gypi included below. + 'test_type': 'gtest', + 'apk_name': 'libyuv_unittest', + 'intermediate_dir': '<(PRODUCT_DIR)/libyuv_unittest_apk', + 'final_apk_path': '<(intermediate_dir)/libyuv_unittest-debug.apk', + 'java_in_dir': '<(DEPTH)/testing/android/native_test/java', + 'native_lib_target': 'libyuv_unittest', + 'gyp_managed_install': 0, + }, + 'includes': [ 'build/java_apk.gypi' ], + 'dependencies': [ + '<(DEPTH)/base/base.gyp:base_java', + '<(DEPTH)/build/android/pylib/device/commands/commands.gyp:chromium_commands', + '<(DEPTH)/build/android/pylib/remote/device/dummy/dummy.gyp:remote_device_dummy_apk', + '<(DEPTH)/testing/android/appurify_support.gyp:appurify_support_java', + '<(DEPTH)/testing/android/on_device_instrumentation.gyp:reporter_java', + '<(DEPTH)/tools/android/android_tools.gyp:android_tools', + 'libyuv_unittest', + ], + }, + ], + }], + ], } # Local Variables: diff --git a/setup_links.py b/setup_links.py index 188c51f80..99b526076 100755 --- a/setup_links.py +++ b/setup_links.py @@ -49,13 +49,15 @@ DIRECTORIES = [ 'third_party/libjpeg_turbo', 'third_party/libsrtp', 'third_party/libudev', - 'third_party/libvpx', + 'third_party/libvpx_new', 'third_party/libyuv', 'third_party/llvm-build', + 'third_party/lss', 'third_party/nss', 'third_party/ocmock', 'third_party/openmax_dl', 'third_party/opus', + 'third_party/proguard', 'third_party/protobuf', 'third_party/sqlite', 'third_party/syzygy', @@ -81,9 +83,11 @@ if 'android' in target_os: DIRECTORIES += [ 'base', 'third_party/android_platform', + 'third_party/android_testrunner', 'third_party/android_tools', 'third_party/appurify-python', 'third_party/ashmem', + 'third_party/ijar', 'third_party/jsr-305', 'third_party/junit', 'third_party/libevent', @@ -101,6 +105,7 @@ if 'ios' in target_os: FILES = { 'tools/find_depot_tools.py': None, + 'tools/isolate_driver.py': None, 'third_party/BUILD.gn': None, } diff --git a/util/android/test_runner.py b/util/android/test_runner.py new file mode 100755 index 000000000..8b06b7eab --- /dev/null +++ b/util/android/test_runner.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python +# Copyright 2014 The LibYuv Project Authors. All rights reserved. +# +# Use of this source code is governed by a BSD-style license +# that can be found in the LICENSE file in the root of the source +# tree. An additional intellectual property rights grant can be found +# in the file PATENTS. All contributing project authors may +# be found in the AUTHORS file in the root of the source tree. + +""" +Runs tests on Android devices. + +This script exists to avoid Libyuv being broken by changes in the Chrome Android +test execution toolchain. It also conveniently sets the CHECKOUT_SOURCE_ROOT +environment variable. +""" + +import os +import sys + +SCRIPT_DIR = os.path.dirname(__file__) +ROOT_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, os.pardir, os.pardir)) +CHROMIUM_BUILD_ANDROID_DIR = os.path.join(ROOT_DIR, 'build', 'android') +sys.path.insert(0, CHROMIUM_BUILD_ANDROID_DIR) + + +import test_runner # pylint: disable=W0406 + +def main(): + # Override environment variable to make it possible for the scripts to find + # the root directory (our symlinking of the Chromium build toolchain would + # otherwise make them fail to do so). + os.environ['CHECKOUT_SOURCE_ROOT'] = ROOT_DIR + return test_runner.main() + +if __name__ == '__main__': + sys.exit(main())