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/rtc_tools/BUILD.gn b/rtc_tools/BUILD.gn
index b895d11..56e3a3a 100644
--- a/rtc_tools/BUILD.gn
+++ b/rtc_tools/BUILD.gn
@@ -357,6 +357,7 @@
       "../rtc_base:checks",
       "../test:fileutils",
       "../test:test_main",
+      "//test:test_support",
       "//testing/gtest",
       "//third_party/abseil-cpp/absl/memory",
     ]