blob: 1ba87ac9577d56bb05aa4fdbaf1ab4870def324d [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",
michaeltfcea39d2017-04-20 05:39:30 -070031 "packet_logger.cc",
32 "packet_logger.h",
minyue939df962017-04-19 01:58:38 -070033 "packet_sender.cc",
34 "packet_sender.h",
35 "test_controller.cc",
36 "test_controller.h",
37 ]
38
39 defines = [ "WEBRTC_NETWORK_TESTER_PROTO" ]
40
41 deps = [
42 ":network_tester_config_proto",
43 ":network_tester_packet_proto",
michaeltfcea39d2017-04-20 05:39:30 -070044 "../../base:protobuf_utils",
minyue939df962017-04-19 01:58:38 -070045 "../../base:rtc_task_queue",
46 "../../p2p",
47 ]
48
49 if (!build_with_chromium && is_clang) {
50 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
51 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
52 }
53 }
54
55 network_tester_unittests_resources = [
56 "//resources/network_tester/client_config.dat",
57 "//resources/network_tester/server_config.dat",
58 ]
59
60 if (is_ios) {
61 bundle_data("network_tester_unittests_bundle_data") {
62 testonly = true
63 sources = network_tester_unittests_resources
64 outputs = [
65 "{{bundle_resources_dir}}/{{source_file_part}}",
66 ]
67 }
68 }
69
70 rtc_source_set("network_tester_unittests") {
71 sources = [
72 "network_tester_unittest.cc",
73 ]
74
75 testonly = true
76 deps = [
77 ":network_tester",
78 "//testing/gtest",
79 "//webrtc/base:rtc_base_tests_utils",
80 "//webrtc/test:test_support",
81 ]
82
83 if (is_ios) {
84 deps += [ ":network_tester_unittests_bundle_data" ]
85 }
86
87 defines = [
88 "GTEST_RELATIVE_PATH",
89 "WEBRTC_NETWORK_TESTER_TEST_ENABLED",
90 ]
91
92 data = network_tester_unittests_resources
93
94 if (!build_with_chromium && is_clang) {
95 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
96 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
97 }
98 }
michaeltfcea39d2017-04-20 05:39:30 -070099
100 rtc_executable("network_tester_server") {
101 sources = [
102 "server.cc",
103 ]
104
105 deps = [
106 ":network_tester",
107 ]
108
109 if (!build_with_chromium && is_clang) {
110 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
111 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
112 }
113 }
minyue939df962017-04-19 01:58:38 -0700114}