Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / base / test / BUILD.gn
blobc55400d60ce47ebb9afaab68a2bff59ca4c9645f
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 import("//build/config/ui.gni")
7 if (is_android) {
8   import("//build/config/android/rules.gni")
11 source_set("test_support") {
12   sources = [
13     "expectations/expectation.cc",
14     "expectations/expectation.h",
15     "expectations/parser.cc",
16     "expectations/parser.h",
17     "gtest_xml_util.cc",
18     "gtest_xml_util.h",
19     "histogram_tester.cc",
20     "histogram_tester.h",
21     "launcher/test_launcher.cc",
22     "launcher/test_launcher.h",
23     "launcher/test_result.cc",
24     "launcher/test_result.h",
25     "launcher/test_results_tracker.cc",
26     "launcher/test_results_tracker.h",
27     "launcher/unit_test_launcher.cc",
28     "launcher/unit_test_launcher.h",
29     "launcher/unit_test_launcher_ios.cc",
30     "mock_chrome_application_mac.h",
31     "mock_chrome_application_mac.mm",
32     "mock_devices_changed_observer.cc",
33     "mock_devices_changed_observer.h",
34     "mock_time_provider.cc",
35     "mock_time_provider.h",
36     "multiprocess_test.cc",
37     "multiprocess_test.h",
38     "multiprocess_test_android.cc",
39     "null_task_runner.cc",
40     "null_task_runner.h",
41     "perf_log.cc",
42     "perf_log.h",
43     "perf_test_suite.cc",
44     "perf_test_suite.h",
45     "perf_time_logger.cc",
46     "perf_time_logger.h",
47     "power_monitor_test_base.cc",
48     "power_monitor_test_base.h",
49     "scoped_locale.cc",
50     "scoped_locale.h",
51     "scoped_path_override.cc",
52     "scoped_path_override.h",
53     "sequenced_task_runner_test_template.cc",
54     "sequenced_task_runner_test_template.h",
55     "sequenced_worker_pool_owner.cc",
56     "sequenced_worker_pool_owner.h",
57     "simple_test_clock.cc",
58     "simple_test_clock.h",
59     "simple_test_tick_clock.cc",
60     "simple_test_tick_clock.h",
61     "task_runner_test_template.cc",
62     "task_runner_test_template.h",
63     "test_file_util.cc",
64     "test_file_util.h",
65     "test_file_util_android.cc",
66     "test_file_util_linux.cc",
67     "test_file_util_mac.cc",
68     "test_file_util_posix.cc",
69     "test_file_util_win.cc",
70     "test_listener_ios.h",
71     "test_listener_ios.mm",
72     "test_pending_task.cc",
73     "test_pending_task.h",
74     "test_process_killer_win.cc",
75     "test_process_killer_win.h",
76     "test_reg_util_win.cc",
77     "test_reg_util_win.h",
78     "test_shortcut_win.cc",
79     "test_shortcut_win.h",
80     "test_simple_task_runner.cc",
81     "test_simple_task_runner.h",
82     "test_suite.cc",
83     "test_suite.h",
84     "test_support_android.cc",
85     "test_support_android.h",
86     "test_support_ios.h",
87     "test_support_ios.mm",
88     "test_switches.cc",
89     "test_switches.h",
90     "test_timeouts.cc",
91     "test_timeouts.h",
92     "thread_test_helper.cc",
93     "thread_test_helper.h",
94     "trace_event_analyzer.cc",
95     "trace_event_analyzer.h",
96     "values_test_util.cc",
97     "values_test_util.h",
98   ]
99   deps = [
100     "//base",
101     "//base/third_party/dynamic_annotations",
102     "//base:i18n",
103     "//base:base_static",
104     "//testing/gmock",
105     "//testing/gtest",
106     "//third_party/libxml"
107   ]
109   if (!is_posix) {
110     sources -= [
111       "scoped_locale.cc",
112       "scoped_locale.h",
113     ]
114   }
115   if (is_ios) {
116     # iOS uses its own unit test launcher.
117     sources -= [ "launcher/unit_test_launcher.cc" ]
119     # Pull in specific Mac files for iOS (which have been filtered out
120     # by file name rules).
121     set_sources_assignment_filter([])
122     sources += [ "test_file_util_mac.cc" ]
123   }
125   if (is_android) {
126     deps += [ ":base_unittests_jni_headers" ]
127   }
130 config("perf_test_config") {
131   defines = [ "PERF_TEST" ]
134 source_set("test_support_perf") {
135   sources = [
136     "run_all_perftests.cc",
137   ]
138   deps = [
139     ":test_support",
140     "//base",
141     "//testing/gtest",
142   ]
144   direct_dependent_configs = [ ":perf_test_config" ]
147 source_set("run_all_unittests") {
148   sources = [
149     "run_all_unittests.cc",
150   ]
151   deps = [
152     ":test_support",
153   ]
156 if (is_android) {
157   generate_jni("base_unittests_jni_headers") {
158     sources = [
159       "android/java/src/org/chromium/base/ContentUriTestUtils.java",
160     ]
161     jni_package = "base"
162   }