blob: 000579e6eeef83d96231373425fd87ea28f00cc1 [file] [log] [blame]
Primiano Tucci13331342017-10-25 17:08:13 +01001# Copyright (C) 2017 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
Primiano Tuccid7d1be02017-10-30 17:41:34 +000015source_set("base") {
16 sources = [
17 "build_config.h",
18 "logging.h",
19 "scoped_file.h",
20 "task_runner.h",
Primiano Tucci575af772017-11-08 18:14:17 +000021 "thread_checker.cc",
22 "thread_checker.h",
Sami Kyostila2c6c2f52017-11-21 16:08:16 +000023 "unix_task_runner.cc",
24 "unix_task_runner.h",
Primiano Tuccid7d1be02017-10-30 17:41:34 +000025 "utils.h",
Primiano Tucci575af772017-11-08 18:14:17 +000026 "weak_ptr.h",
Primiano Tuccid7d1be02017-10-30 17:41:34 +000027 ]
Sami Kyostila73d41c82017-11-24 18:38:46 +000028
29 if (target_os == "android") {
30 sources += [
31 "android_task_runner.cc",
32 "android_task_runner.h",
33 ]
34 libs = [ "android" ]
35 }
Primiano Tuccid7d1be02017-10-30 17:41:34 +000036}
37
38source_set("test_support") {
39 testonly = true
40 deps += [ ":base" ]
41 sources = [
42 "test/test_task_runner.cc",
43 "test/test_task_runner.h",
44 ]
45}
46
Primiano Tucci13331342017-10-25 17:08:13 +010047executable("base_unittests") {
48 testonly = true
49 deps += [
Primiano Tuccid7d1be02017-10-30 17:41:34 +000050 ":base",
51 ":test_support",
Primiano Tucci13331342017-10-25 17:08:13 +010052 "//buildtools:gmock",
53 "//buildtools:gtest",
54 "//buildtools:gtest_main",
55 ]
56 sources = [
Primiano Tuccid7d1be02017-10-30 17:41:34 +000057 "scoped_file_unittest.cc",
Sami Kyostila73d41c82017-11-24 18:38:46 +000058 "task_runner_unittest.cc",
Primiano Tucci575af772017-11-08 18:14:17 +000059 "thread_checker_unittest.cc",
Primiano Tuccid7d1be02017-10-30 17:41:34 +000060 "utils_unittest.cc",
Primiano Tucci575af772017-11-08 18:14:17 +000061 "weak_ptr_unittest.cc",
Primiano Tucci13331342017-10-25 17:08:13 +010062 ]
63}