Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / base / test / BUILD.gn
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.
4
5 import("//build/config/ui.gni")
6
7 source_set("test_support") {
8   sources = [
9     "expectations/expectation.cc",
10     "expectations/expectation.h",
11     "expectations/parser.cc",
12     "expectations/parser.h",
13     "gtest_xml_util.cc",
14     "gtest_xml_util.h",
15     "launcher/test_launcher.cc",
16     "launcher/test_launcher.h",
17     "launcher/test_result.cc",
18     "launcher/test_result.h",
19     "launcher/test_results_tracker.cc",
20     "launcher/test_results_tracker.h",
21     "launcher/unit_test_launcher.cc",
22     "launcher/unit_test_launcher.h",
23     "launcher/unit_test_launcher_ios.cc",
24     "mock_chrome_application_mac.h",
25     "mock_chrome_application_mac.mm",
26     "mock_devices_changed_observer.cc",
27     "mock_devices_changed_observer.h",
28     "mock_time_provider.cc",
29     "mock_time_provider.h",
30     "multiprocess_test.cc",
31     "multiprocess_test.h",
32     "multiprocess_test_android.cc",
33     "null_task_runner.cc",
34     "null_task_runner.h",
35     "perf_log.cc",
36     "perf_log.h",
37     "perf_test_suite.cc",
38     "perf_test_suite.h",
39     "perf_time_logger.cc",
40     "perf_time_logger.h",
41     "power_monitor_test_base.cc",
42     "power_monitor_test_base.h",
43     "scoped_locale.cc",
44     "scoped_locale.h",
45     "scoped_path_override.cc",
46     "scoped_path_override.h",
47     "sequenced_task_runner_test_template.cc",
48     "sequenced_task_runner_test_template.h",
49     "sequenced_worker_pool_owner.cc",
50     "sequenced_worker_pool_owner.h",
51     "simple_test_clock.cc",
52     "simple_test_clock.h",
53     "simple_test_tick_clock.cc",
54     "simple_test_tick_clock.h",
55     "task_runner_test_template.cc",
56     "task_runner_test_template.h",
57     "test_file_util.cc",
58     "test_file_util.h",
59     "test_file_util_linux.cc",
60     "test_file_util_mac.cc",
61     "test_file_util_posix.cc",
62     "test_file_util_win.cc",
63     "test_listener_ios.h",
64     "test_listener_ios.mm",
65     "test_pending_task.cc",
66     "test_pending_task.h",
67     "test_process_killer_win.cc",
68     "test_process_killer_win.h",
69     "test_reg_util_win.cc",
70     "test_reg_util_win.h",
71     "test_shortcut_win.cc",
72     "test_shortcut_win.h",
73     "test_simple_task_runner.cc",
74     "test_simple_task_runner.h",
75     "test_suite.cc",
76     "test_suite.h",
77     "test_support_android.cc",
78     "test_support_android.h",
79     "test_support_ios.h",
80     "test_support_ios.mm",
81     "test_switches.cc",
82     "test_switches.h",
83     "test_timeouts.cc",
84     "test_timeouts.h",
85     "thread_test_helper.cc",
86     "thread_test_helper.h",
87     "trace_event_analyzer.cc",
88     "trace_event_analyzer.h",
89     "values_test_util.cc",
90     "values_test_util.h",
91   ]
92   deps = [
93     "//base",
94     "//base/third_party/dynamic_annotations",
95     "//base:i18n",
96     "//base:base_static",
97     "//testing/gmock",
98     "//testing/gtest",
99     "//third_party/libxml"
100   ]
101
102   if (!is_posix) {
103     sources -= [
104       "scoped_locale.cc",
105       "scoped_locale.h",
106     ]
107   }
108   if (is_ios) {
109     # iOS uses its own unit test launcher.
110     sources -= [ "launcher/unit_test_launcher.cc" ]
111
112     # Pull in specific Mac files for iOS (which have been filtered out
113     # by file name rules).
114     set_sources_assignment_filter([])
115     sources += [ "test_file_util_mac.cc" ]
116   }
117   if (toolkit_uses_gtk) {
118     configs += [ "//build/config/linux:gtk" ]
119   }
120 }
121
122 config("perf_test_config") {
123   defines = [ "PERF_TEST" ]
124 }
125
126 static_library("test_support_perf") {
127   sources = [
128     "run_all_perftests.cc",
129   ]
130   deps = [
131     ":test_support",
132     "//base",
133     "//testing/gtest",
134   ]
135
136   direct_dependent_configs = [ ":perf_test_config" ]
137
138   if (toolkit_uses_gtk) {
139     configs += [ "//build/config/linux:gtk" ]
140   }
141 }
142
143 source_set("run_all_unittests") {
144   sources = [
145     "run_all_unittests.cc",
146   ]
147   deps = [
148     ":test_support",
149   ]
150 }