minyue | 939df96 | 2017-04-19 01:58:38 -0700 | [diff] [blame] | 1 | # 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 | |
| 9 | import("../../webrtc.gni") |
| 10 | import("//third_party/protobuf/proto_library.gni") |
| 11 | |
| 12 | if (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", |
michaelt | fcea39d | 2017-04-20 05:39:30 -0700 | [diff] [blame^] | 31 | "packet_logger.cc", |
| 32 | "packet_logger.h", |
minyue | 939df96 | 2017-04-19 01:58:38 -0700 | [diff] [blame] | 33 | "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", |
michaelt | fcea39d | 2017-04-20 05:39:30 -0700 | [diff] [blame^] | 44 | "../../base:protobuf_utils", |
minyue | 939df96 | 2017-04-19 01:58:38 -0700 | [diff] [blame] | 45 | "../../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 | } |
michaelt | fcea39d | 2017-04-20 05:39:30 -0700 | [diff] [blame^] | 99 | |
| 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 | } |
minyue | 939df96 | 2017-04-19 01:58:38 -0700 | [diff] [blame] | 114 | } |