diff --git a/BUILD.gn b/BUILD.gn index 554c5b89ce..249094bdd6 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -58,7 +58,6 @@ if (!build_with_chromium) { "modules/video_capture:video_capture_internal_impl", "pc:peerconnection_unittests", "pc:rtc_pc_unittests", - "rtc_base:rtc_base_tests_utils", "stats:rtc_stats_unittests", "system_wrappers:system_wrappers_unittests", "test", @@ -476,7 +475,6 @@ if (rtc_include_tests) { "p2p:rtc_p2p_unittests", "rtc_base:rtc_base_approved_unittests", "rtc_base:rtc_base_tests_main", - "rtc_base:rtc_base_tests_utils", "rtc_base:rtc_base_unittests", "rtc_base:rtc_json_unittests", "rtc_base:rtc_numerics_unittests", @@ -544,7 +542,6 @@ if (rtc_include_tests) { # should move them to a more appropriate test suite. "call:call_tests", "modules/video_capture", - "rtc_base:rtc_base_tests_utils", "test:test_common", "test:test_main", "test:video_test_common", diff --git a/api/BUILD.gn b/api/BUILD.gn index 22f6b2ea41..fe27c7b888 100644 --- a/api/BUILD.gn +++ b/api/BUILD.gn @@ -674,8 +674,8 @@ if (rtc_include_tests) { ":libjingle_peerconnection_api", ":loopback_media_transport", "../rtc_base:checks", + "../rtc_base:gunit_helpers", "../rtc_base:rtc_base_approved", - "../rtc_base:rtc_base_tests_utils", "../test:test_support", "units:units_unittests", ] diff --git a/audio/BUILD.gn b/audio/BUILD.gn index c835f24dbe..37a7e07ac3 100644 --- a/audio/BUILD.gn +++ b/audio/BUILD.gn @@ -150,6 +150,7 @@ if (rtc_include_tests) { "../logging:mocks", "../logging:rtc_event_log_api", "../modules/audio_device:mock_audio_device", + "../rtc_base:rtc_base_tests_utils", # For TestAudioDeviceModule "../modules/audio_device:audio_device_impl", @@ -163,7 +164,6 @@ if (rtc_include_tests) { "../modules/utility", "../rtc_base:checks", "../rtc_base:rtc_base_approved", - "../rtc_base:rtc_base_tests_utils", "../rtc_base:rtc_task_queue", "../rtc_base:safe_compare", "../system_wrappers:system_wrappers", diff --git a/media/BUILD.gn b/media/BUILD.gn index ea234331a8..b6f98c67b7 100644 --- a/media/BUILD.gn +++ b/media/BUILD.gn @@ -457,6 +457,7 @@ if (rtc_include_tests) { "../modules/video_coding:video_coding_utility", "../p2p:rtc_p2p", "../rtc_base:checks", + "../rtc_base:gunit_helpers", "../rtc_base:rtc_task_queue", "../rtc_base:stringutils", "//third_party/abseil-cpp/absl/memory", @@ -507,7 +508,6 @@ if (rtc_include_tests) { "../call:mock_rtp_interfaces", "../rtc_base:rtc_base", "../rtc_base:rtc_base_approved", - "../rtc_base:rtc_base_tests_utils", "../rtc_base:rtc_task_queue_for_test", "../rtc_base/third_party/sigslot", "../test:test_support", @@ -554,6 +554,8 @@ if (rtc_include_tests) { "../pc:rtc_pc", "../pc:rtc_pc_base", "../rtc_base:checks", + "../rtc_base:gunit_helpers", + "../rtc_base:rtc_base_tests_utils", "../rtc_base:rtc_task_queue", "../rtc_base:stringutils", "../test:field_trial", @@ -656,7 +658,6 @@ if (rtc_include_tests) { "../rtc_base:rtc_base", "../rtc_base:rtc_base_approved", "../rtc_base:rtc_base_tests_main", - "../rtc_base:rtc_base_tests_utils", "../test:audio_codec_mocks", "../test:test_support", "../test:video_test_common", diff --git a/modules/audio_coding/BUILD.gn b/modules/audio_coding/BUILD.gn index 3422665ce2..db71079a7e 100644 --- a/modules/audio_coding/BUILD.gn +++ b/modules/audio_coding/BUILD.gn @@ -1134,7 +1134,6 @@ rtc_source_set("neteq_test_tools") { "../../rtc_base:checks", "../../rtc_base:rtc_base", "../../rtc_base:rtc_base_approved", - "../../rtc_base:rtc_base_tests_utils", "../../rtc_base/system:arch", "../../test:rtp_test_utils", "../rtp_rtcp", diff --git a/modules/audio_processing/BUILD.gn b/modules/audio_processing/BUILD.gn index 4ea1e75ec9..66b07df199 100644 --- a/modules/audio_processing/BUILD.gn +++ b/modules/audio_processing/BUILD.gn @@ -414,6 +414,7 @@ if (rtc_include_tests) { "../../rtc_base:protobuf_utils", "../../rtc_base:rtc_base", "../../rtc_base:rtc_base_approved", + "../../rtc_base:rtc_base_tests_utils", "../../rtc_base:safe_minmax", "../../rtc_base/system:arch", "../../rtc_base/system:file_wrapper", @@ -459,7 +460,6 @@ if (rtc_include_tests) { ":audioproc_unittest_proto", ":runtime_settings_protobuf_utils", "../../api/audio:audio_frame_api", - "../../rtc_base:rtc_base_tests_utils", "../../rtc_base:rtc_task_queue", "aec_dump", "aec_dump:aec_dump_unittests", diff --git a/modules/audio_processing/agc2/BUILD.gn b/modules/audio_processing/agc2/BUILD.gn index 22fd9db77c..5431a150c2 100644 --- a/modules/audio_processing/agc2/BUILD.gn +++ b/modules/audio_processing/agc2/BUILD.gn @@ -192,8 +192,8 @@ rtc_source_set("adaptive_digital_unittests") { "../../../api:array_view", "../../../common_audio", "../../../rtc_base:checks", + "../../../rtc_base:gunit_helpers", "../../../rtc_base:rtc_base_approved", - "../../../rtc_base:rtc_base_tests_utils", ] } @@ -204,7 +204,7 @@ rtc_source_set("biquad_filter_unittests") { ] deps = [ ":biquad_filter", - "../../../rtc_base:rtc_base_tests_utils", + "../../../rtc_base:gunit_helpers", ] } @@ -232,8 +232,8 @@ rtc_source_set("fixed_digital_unittests") { "../../../api:array_view", "../../../common_audio", "../../../rtc_base:checks", + "../../../rtc_base:gunit_helpers", "../../../rtc_base:rtc_base_approved", - "../../../rtc_base:rtc_base_tests_utils", "../../../system_wrappers:metrics", "//third_party/abseil-cpp/absl/memory", ] @@ -254,8 +254,8 @@ rtc_source_set("noise_estimator_unittests") { "..:audio_frame_view", "../../../api:array_view", "../../../rtc_base:checks", + "../../../rtc_base:gunit_helpers", "../../../rtc_base:rtc_base_approved", - "../../../rtc_base:rtc_base_tests_utils", ] } @@ -267,7 +267,7 @@ rtc_source_set("rnn_vad_with_level_unittests") { deps = [ ":rnn_vad_with_level", "..:audio_frame_view", - "../../../rtc_base:rtc_base_tests_utils", + "../../../rtc_base:gunit_helpers", ] } diff --git a/modules/congestion_controller/BUILD.gn b/modules/congestion_controller/BUILD.gn index c2e4ea269d..73d81f16ec 100644 --- a/modules/congestion_controller/BUILD.gn +++ b/modules/congestion_controller/BUILD.gn @@ -110,7 +110,6 @@ if (rtc_include_tests) { "../../rtc_base:checks", "../../rtc_base:rtc_base", "../../rtc_base:rtc_base_approved", - "../../rtc_base:rtc_base_tests_utils", "../../rtc_base/network:sent_packet", "../../system_wrappers", "../../test:field_trial", diff --git a/modules/congestion_controller/goog_cc/BUILD.gn b/modules/congestion_controller/goog_cc/BUILD.gn index 394f3c378b..38169bbb4d 100644 --- a/modules/congestion_controller/goog_cc/BUILD.gn +++ b/modules/congestion_controller/goog_cc/BUILD.gn @@ -237,7 +237,6 @@ if (rtc_include_tests) { "../../../logging:mocks", "../../../rtc_base:checks", "../../../rtc_base:rtc_base_approved", - "../../../rtc_base:rtc_base_tests_utils", "../../../rtc_base/experiments:alr_experiment", "../../../system_wrappers", "../../../system_wrappers:field_trial", diff --git a/modules/congestion_controller/rtp/BUILD.gn b/modules/congestion_controller/rtp/BUILD.gn index 5ee6b4f537..bffe1f893e 100644 --- a/modules/congestion_controller/rtp/BUILD.gn +++ b/modules/congestion_controller/rtp/BUILD.gn @@ -131,7 +131,6 @@ if (rtc_include_tests) { "../../../rtc_base:checks", "../../../rtc_base:rtc_base", "../../../rtc_base:rtc_base_approved", - "../../../rtc_base:rtc_base_tests_utils", "../../../rtc_base/network:sent_packet", "../../../system_wrappers", "../../../test:field_trial", diff --git a/p2p/BUILD.gn b/p2p/BUILD.gn index f0033f19d3..29e633c5d2 100644 --- a/p2p/BUILD.gn +++ b/p2p/BUILD.gn @@ -140,6 +140,7 @@ if (rtc_include_tests) { ":rtc_p2p", "../api:libjingle_peerconnection_api", "../api:ortc_api", + "../rtc_base:gunit_helpers", "../rtc_base:rtc_base", "../rtc_base:rtc_base_approved", "../rtc_base:rtc_base_tests_utils", @@ -181,10 +182,12 @@ if (rtc_include_tests) { ":rtc_p2p", "../api:ortc_api", "../rtc_base:checks", + "../rtc_base:gunit_helpers", "../rtc_base:rtc_base", "../rtc_base:rtc_base_approved", "../rtc_base:rtc_base_tests_utils", "../rtc_base:stringutils", + "../rtc_base:testclient", "../system_wrappers:metrics", "../test:test_support", "//testing/gtest", @@ -225,6 +228,7 @@ if (rtc_include_tests) { ":p2p_test_utils", ":rtc_p2p", "../rtc_base:checks", + "../rtc_base:gunit_helpers", "../rtc_base:rtc_base", "../rtc_base:rtc_base_tests_utils", "//testing/gtest", diff --git a/pc/BUILD.gn b/pc/BUILD.gn index 61df92f516..65ab33a50b 100644 --- a/pc/BUILD.gn +++ b/pc/BUILD.gn @@ -279,6 +279,7 @@ if (rtc_include_tests) { "../p2p:p2p_test_utils", "../p2p:rtc_p2p", "../rtc_base:checks", + "../rtc_base:gunit_helpers", "../rtc_base:rtc_base", "../rtc_base:rtc_base_approved", "../rtc_base:rtc_base_tests_main", @@ -318,6 +319,7 @@ if (rtc_include_tests) { "../p2p:p2p_test_utils", "../p2p:rtc_p2p", "../pc:peerconnection", + "../rtc_base:gunit_helpers", "../rtc_base:rtc_base", "../rtc_base:rtc_base_approved", "../rtc_base:rtc_base_tests_utils", @@ -380,9 +382,9 @@ if (rtc_include_tests) { "../modules/audio_processing:audio_processing", "../p2p:p2p_test_utils", "../rtc_base:checks", + "../rtc_base:gunit_helpers", "../rtc_base:rtc_base", "../rtc_base:rtc_base_approved", - "../rtc_base:rtc_base_tests_utils", "../rtc_base:rtc_task_queue", "../rtc_base/third_party/sigslot", "../test:test_support", @@ -460,6 +462,8 @@ if (rtc_include_tests) { "../api/units:time_delta", "../logging:fake_rtc_event_log", "../rtc_base:checks", + "../rtc_base:gunit_helpers", + "../rtc_base:rtc_base_tests_utils", "../rtc_base:stringutils", "../rtc_base/third_party/base64", "../system_wrappers:metrics", @@ -504,7 +508,6 @@ if (rtc_include_tests) { "../rtc_base:rtc_base", "../rtc_base:rtc_base_approved", "../rtc_base:rtc_base_tests_main", - "../rtc_base:rtc_base_tests_utils", "../rtc_base:rtc_task_queue", "../rtc_base:safe_conversions", "../test:audio_codec_mocks", diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn index ae891078cb..f188d47c37 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -934,11 +934,41 @@ rtc_source_set("gtest_prod") { ] } +rtc_source_set("gunit_helpers") { + testonly = true + sources = [ + "gunit.cc", + "gunit.h", + ] + deps = [ + ":logging", + ":rtc_base", + ":rtc_base_tests_utils", + ":stringutils", + "../test:test_support", + ] +} + +rtc_source_set("testclient") { + testonly = true + sources = [ + "testclient.cc", + "testclient.h", + ] + deps = [ + ":criticalsection", + ":gunit_helpers", + ":macromagic", + ":rtc_base", + ":rtc_base_tests_utils", + ":timeutils", + "//third_party/abseil-cpp/absl/memory:memory", + ] +} + rtc_source_set("rtc_base_tests_utils") { testonly = true sources = [ - # Also use this as a convenient dumping ground for misc files that are - # included by multiple targets below. "cpu_time.cc", "cpu_time.h", "fake_mdns_responder.h", @@ -949,8 +979,6 @@ rtc_source_set("rtc_base_tests_utils") { "fakesslidentity.h", "firewallsocketserver.cc", "firewallsocketserver.h", - "gunit.cc", - "gunit.h", "memory_stream.cc", "memory_stream.h", "memory_usage.cc", @@ -969,8 +997,6 @@ rtc_source_set("rtc_base_tests_utils") { "socketstream.h", "testbase64.h", "testcertificateverifier.h", - "testclient.cc", - "testclient.h", "testechoserver.cc", "testechoserver.h", "testutils.cc", @@ -981,16 +1007,10 @@ rtc_source_set("rtc_base_tests_utils") { deps = [ ":checks", ":rtc_base", - ":stringutils", "../api/units:time_delta", - "../test:test_support", - "system:fallthrough", "third_party/sigslot", "//third_party/abseil-cpp/absl/memory", ] - public_deps = [ - "//testing/gtest", - ] } rtc_source_set("rtc_task_queue_for_test") { @@ -1015,6 +1035,7 @@ if (rtc_include_tests) { "sigslot_unittest.cc", ] deps = [ + ":gunit_helpers", ":rtc_base", ":rtc_base_tests_utils", "third_party/sigslot", @@ -1027,6 +1048,7 @@ if (rtc_include_tests) { "unittest_main.cc", ] deps = [ + ":gunit_helpers", ":rtc_base", ":rtc_base_approved", ":rtc_base_tests_utils", @@ -1055,9 +1077,11 @@ if (rtc_include_tests) { ] deps = [ ":checks", + ":gunit_helpers", ":rtc_base", ":rtc_base_tests_main", ":rtc_base_tests_utils", + ":testclient", "../system_wrappers:system_wrappers", "../test:fileutils", "../test:test_support", @@ -1124,6 +1148,7 @@ if (rtc_include_tests) { } deps = [ ":checks", + ":gunit_helpers", ":rate_limiter", ":rtc_base", ":rtc_base_approved", @@ -1134,6 +1159,7 @@ if (rtc_include_tests) { ":safe_minmax", ":sanitizer", ":stringutils", + ":testclient", "../api:array_view", "../system_wrappers:system_wrappers", "../test:fileutils", @@ -1153,6 +1179,7 @@ if (rtc_include_tests) { "task_queue_unittest.cc", ] deps = [ + ":gunit_helpers", ":rtc_base_approved", ":rtc_base_tests_main", ":rtc_base_tests_utils", @@ -1186,6 +1213,7 @@ if (rtc_include_tests) { "weak_ptr_unittest.cc", ] deps = [ + ":gunit_helpers", ":rtc_base_approved", ":rtc_base_tests_main", ":rtc_base_tests_utils", @@ -1221,6 +1249,7 @@ if (rtc_include_tests) { "strings/json_unittest.cc", ] deps = [ + ":gunit_helpers", ":rtc_base_tests_main", ":rtc_base_tests_utils", ":rtc_json", @@ -1272,9 +1301,11 @@ if (rtc_include_tests) { } deps = [ ":checks", + ":gunit_helpers", ":rtc_base_tests_main", ":rtc_base_tests_utils", ":stringutils", + ":testclient", "../api:array_view", "../test:fileutils", "../test:test_support", diff --git a/rtc_base/experiments/BUILD.gn b/rtc_base/experiments/BUILD.gn index 35d1da9393..d36a43e946 100644 --- a/rtc_base/experiments/BUILD.gn +++ b/rtc_base/experiments/BUILD.gn @@ -129,6 +129,7 @@ if (rtc_include_tests) { ":normalize_simulcast_size_experiment", ":quality_scaling_experiment", ":rtt_mult_experiment", + "..:gunit_helpers", "../:rtc_base_tests_main", "../:rtc_base_tests_utils", "../../system_wrappers:field_trial", diff --git a/rtc_base/testutils.h b/rtc_base/testutils.h index 6b3733fe55..ac74203cf9 100644 --- a/rtc_base/testutils.h +++ b/rtc_base/testutils.h @@ -19,7 +19,6 @@ #include #include "rtc_base/asyncsocket.h" #include "rtc_base/checks.h" -#include "rtc_base/gunit.h" #include "rtc_base/stream.h" namespace webrtc { diff --git a/rtc_tools/network_tester/BUILD.gn b/rtc_tools/network_tester/BUILD.gn index af84903b7f..47b8143047 100644 --- a/rtc_tools/network_tester/BUILD.gn +++ b/rtc_tools/network_tester/BUILD.gn @@ -6,8 +6,8 @@ # in the file PATENTS. All contributing project authors may # be found in the AUTHORS file in the root of the source tree. -import("../../webrtc.gni") import("//third_party/protobuf/proto_library.gni") +import("../../webrtc.gni") if (rtc_enable_protobuf) { proto_library("network_tester_config_proto") { @@ -81,7 +81,7 @@ if (rtc_enable_protobuf) { deps = [ ":network_tester", - "../../rtc_base:rtc_base_tests_utils", + "../../rtc_base:gunit_helpers", "../../test:fileutils", "../../test:test_support", "//testing/gtest", diff --git a/sdk/BUILD.gn b/sdk/BUILD.gn index 4f67d1878e..60ea4734e9 100644 --- a/sdk/BUILD.gn +++ b/sdk/BUILD.gn @@ -1073,8 +1073,8 @@ if (is_ios || is_mac) { "../media:rtc_media_base", "../media:rtc_media_tests_utils", "../modules:module_api", + "../rtc_base:gunit_helpers", "../rtc_base:rtc_base", - "../rtc_base:rtc_base_tests_utils", "../system_wrappers:system_wrappers", "//third_party/libyuv", ] @@ -1193,7 +1193,7 @@ if (is_ios || is_mac) { "../modules/audio_processing:api", "../modules/audio_processing:audio_processing", "../modules/video_coding:video_codec_interface", - "../rtc_base:rtc_base_tests_utils", + "../rtc_base:gunit_helpers", "../rtc_base/system:unused", "../test:test_support", "//third_party/ocmock", diff --git a/stats/BUILD.gn b/stats/BUILD.gn index bd19952e28..c67a5be365 100644 --- a/stats/BUILD.gn +++ b/stats/BUILD.gn @@ -57,9 +57,9 @@ if (rtc_include_tests) { ":rtc_stats_test_utils", "../api:rtc_stats_api", "../rtc_base:checks", + "../rtc_base:gunit_helpers", "../rtc_base:rtc_base_approved", "../rtc_base:rtc_base_tests_main", - "../rtc_base:rtc_base_tests_utils", "../rtc_base:rtc_json", ] diff --git a/test/fuzzers/BUILD.gn b/test/fuzzers/BUILD.gn index 1909c8a902..43de5f998c 100644 --- a/test/fuzzers/BUILD.gn +++ b/test/fuzzers/BUILD.gn @@ -6,9 +6,9 @@ # in the file PATENTS. All contributing project authors may # be found in the AUTHORS file in the root of the source tree. -import("../../webrtc.gni") import("//build/config/features.gni") import("//testing/libfuzzer/fuzzer_test.gni") +import("../../webrtc.gni") rtc_static_library("webrtc_fuzzer_main") { sources = [ @@ -364,7 +364,6 @@ webrtc_fuzzer_test("neteq_rtp_fuzzer") { "../../modules/audio_coding:pcm16b", "../../modules/rtp_rtcp:rtp_rtcp_format", "../../rtc_base:rtc_base_approved", - "../../rtc_base:rtc_base_tests_utils", ] } @@ -379,7 +378,6 @@ webrtc_fuzzer_test("neteq_signal_fuzzer") { "../../modules/audio_coding:neteq_tools_minimal", "../../modules/audio_coding:pcm16b", "../../rtc_base:rtc_base_approved", - "../../rtc_base:rtc_base_tests_utils", ] } diff --git a/test/scenario/BUILD.gn b/test/scenario/BUILD.gn index 622827fd00..e9bda5112c 100644 --- a/test/scenario/BUILD.gn +++ b/test/scenario/BUILD.gn @@ -116,7 +116,6 @@ if (rtc_include_tests) { "../../logging:mocks", "../../rtc_base:checks", "../../rtc_base:rtc_base_approved", - "../../rtc_base:rtc_base_tests_utils", "../../system_wrappers", "../../system_wrappers:field_trial", "../../test:field_trial",