Extract functionality of test_main into separate library.

Extract functionality of test_main into separate library to be able to
reuse it if another main will be required.

Bug: webrtc:5996
Change-Id: I2925b4240bd0e4fb884b43bb16667ca2d6216bbd
Reviewed-on: https://webrtc-review.googlesource.com/c/105921
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25172}
diff --git a/modules/BUILD.gn b/modules/BUILD.gn
index 8127244..1df9865 100644
--- a/modules/BUILD.gn
+++ b/modules/BUILD.gn
@@ -236,6 +236,7 @@
     deps = [
       ":module_api",
       "../test:test_main",
+      "../test:test_support",
       "audio_coding:audio_coding_unittests",
       "audio_device:audio_device_unittests",
       "audio_mixer:audio_mixer_unittests",
diff --git a/modules/audio_coding/BUILD.gn b/modules/audio_coding/BUILD.gn
index 44f9a8b..9bad88c 100644
--- a/modules/audio_coding/BUILD.gn
+++ b/modules/audio_coding/BUILD.gn
@@ -1479,6 +1479,7 @@
              "../../rtc_base/system:arch",
              "../../test:test_main",
              "//testing/gtest",
+             "//test:test_support",
            ] + audio_coding_deps
 
     data = audio_decoder_unittests_resources
@@ -1597,6 +1598,7 @@
       "../../rtc_base:rtc_base_approved",
       "../../test:test_main",
       "../audio_processing",
+      "//test:test_support",
       "//testing/gtest",
     ]
   }
@@ -1957,6 +1959,7 @@
       "../../rtc_base:rtc_base_approved",
       "../../test:fileutils",
       "../../test:test_main",
+      "//test:test_support",
       "//testing/gtest",
     ]
   }
diff --git a/modules/remote_bitrate_estimator/BUILD.gn b/modules/remote_bitrate_estimator/BUILD.gn
index a8d6850..1e1cadb 100644
--- a/modules/remote_bitrate_estimator/BUILD.gn
+++ b/modules/remote_bitrate_estimator/BUILD.gn
@@ -227,6 +227,7 @@
       "../../rtc_base:rtc_base_approved",
       "../../test:fileutils",
       "../../test:test_main",
+      "//test:test_support",
       "//testing/gtest",
     ]
     data = [
diff --git a/modules/rtp_rtcp/BUILD.gn b/modules/rtp_rtcp/BUILD.gn
index a4774d8..9102562 100644
--- a/modules/rtp_rtcp/BUILD.gn
+++ b/modules/rtp_rtcp/BUILD.gn
@@ -321,6 +321,7 @@
       ":rtp_rtcp",
       "../../test:fileutils",
       "../../test:test_main",
+      "//test:test_support",
       "//testing/gtest",
     ]
   }  # test_packet_masks_metrics
diff --git a/modules/video_capture/BUILD.gn b/modules/video_capture/BUILD.gn
index ef6f335..734fcbf 100644
--- a/modules/video_capture/BUILD.gn
+++ b/modules/video_capture/BUILD.gn
@@ -192,6 +192,7 @@
         "../../system_wrappers:system_wrappers",
         "../../test:video_test_common",
         "../utility",
+        "//test:test_support",
         "//testing/gtest",
       ]
       deps += [ "../../test:test_main" ]