blob: 8b1fa85b65cb0fb32110e08176b2bb5b38d48ff4 [file] [log] [blame]
minyue939df962017-04-19 01:58:38 -07001# Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
2#
3# Use of this source code is governed by a BSD-style license
4# that can be found in the LICENSE file in the root of the source
5# tree. An additional intellectual property rights grant can be found
6# in the file PATENTS. All contributing project authors may
7# be found in the AUTHORS file in the root of the source tree.
8
9import("../../webrtc.gni")
10import("//third_party/protobuf/proto_library.gni")
11
12if (rtc_enable_protobuf) {
13 proto_library("network_tester_config_proto") {
14 sources = [
15 "network_tester_config.proto",
16 ]
17 proto_out_dir = "webrtc/tools/network_tester"
18 }
19
20 proto_library("network_tester_packet_proto") {
21 sources = [
22 "network_tester_packet.proto",
23 ]
24 proto_out_dir = "webrtc/tools/network_tester"
25 }
26
27 rtc_static_library("network_tester") {
28 sources = [
29 "config_reader.cc",
30 "config_reader.h",
31 "packet_sender.cc",
32 "packet_sender.h",
33 "test_controller.cc",
34 "test_controller.h",
35 ]
36
37 defines = [ "WEBRTC_NETWORK_TESTER_PROTO" ]
38
39 deps = [
40 ":network_tester_config_proto",
41 ":network_tester_packet_proto",
42 "../../base:rtc_task_queue",
43 "../../p2p",
44 ]
45
46 if (!build_with_chromium && is_clang) {
47 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
48 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
49 }
50 }
51
52 network_tester_unittests_resources = [
53 "//resources/network_tester/client_config.dat",
54 "//resources/network_tester/server_config.dat",
55 ]
56
57 if (is_ios) {
58 bundle_data("network_tester_unittests_bundle_data") {
59 testonly = true
60 sources = network_tester_unittests_resources
61 outputs = [
62 "{{bundle_resources_dir}}/{{source_file_part}}",
63 ]
64 }
65 }
66
67 rtc_source_set("network_tester_unittests") {
68 sources = [
69 "network_tester_unittest.cc",
70 ]
71
72 testonly = true
73 deps = [
74 ":network_tester",
75 "//testing/gtest",
76 "//webrtc/base:rtc_base_tests_utils",
77 "//webrtc/test:test_support",
78 ]
79
80 if (is_ios) {
81 deps += [ ":network_tester_unittests_bundle_data" ]
82 }
83
84 defines = [
85 "GTEST_RELATIVE_PATH",
86 "WEBRTC_NETWORK_TESTER_TEST_ENABLED",
87 ]
88
89 data = network_tester_unittests_resources
90
91 if (!build_with_chromium && is_clang) {
92 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
93 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
94 }
95 }
96}