remove hard dependency on queue_testutils for all tests

This dependency drags in a lot of code, which easily leads to circular
dependencies.

Change-Id: I871f196e5461cdf10945015948845a62ff4611ad
diff --git a/aos/build/externals.gyp b/aos/build/externals.gyp
index 315f0bf..2bfe241 100644
--- a/aos/build/externals.gyp
+++ b/aos/build/externals.gyp
@@ -136,11 +136,9 @@
       ],
       'dependencies': [
         'gtest_prod',
-        '<(AOS)/common/common.gyp:queue_testutils',
       ],
       'export_dependent_settings': [
         'gtest_prod',
-        '<(AOS)/common/common.gyp:queue_testutils',
       ],
       'cflags!': ['-Werror'],
       'direct_dependent_settings': {
diff --git a/aos/externals/gtest/gtest_main.cc b/aos/externals/gtest/gtest_main.cc
index 024c502..0f6b60e 100644
--- a/aos/externals/gtest/gtest_main.cc
+++ b/aos/externals/gtest/gtest_main.cc
@@ -2,7 +2,18 @@
 #include <getopt.h>
 
 #include "gtest/gtest.h"
-#include "aos/common/queue_testutils.h"
+
+namespace aos {
+namespace common {
+namespace testing {
+
+// Actually declared/defined in aos/common/queue_testutils.
+void SetLogFileName(const char* filename) __attribute__((weak));
+void ForcePrintLogsDuringTests() __attribute__((weak));
+
+}  // namespace testing
+}  // namespace common
+}  // namespace aos
 
 GTEST_API_ int main(int argc, char **argv) {
   static const struct option long_options[] = {
@@ -36,11 +47,15 @@
         break;
 
       case 'p':
-        aos::common::testing::ForcePrintLogsDuringTests();
+        if (::aos::common::testing::ForcePrintLogsDuringTests) {
+          ::aos::common::testing::ForcePrintLogsDuringTests();
+        }
         break;
 
       case 'o':
-        aos::common::testing::SetLogFileName(optarg);
+        if (::aos::common::testing::SetLogFileName) {
+          ::aos::common::testing::SetLogFileName(optarg);
+        }
         break;
 
       case '?':