buffet: Build buffet_testrunner only when USE_test is defined

Do not compile buffet_testrunner when compiling normal (non-test)
targets.

BUG=chromium:402141
TEST=USE=buffet emerge-link platform2
     USE=buffet FEATURES=test emerge-link platform2

Change-Id: I925a4e024821660a9fe374c24e043e3a89576d38
Reviewed-on: https://chromium-review.googlesource.com/211619
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
diff --git a/buffet/buffet.gyp b/buffet/buffet.gyp
index 820b25c..03b3c81 100644
--- a/buffet/buffet.gyp
+++ b/buffet/buffet.gyp
@@ -72,36 +72,42 @@
         'buffet_common',
       ],
     },
-    {
-      'target_name': 'buffet_testrunner',
-      'type': 'executable',
-      'dependencies': [
-        'buffet_common',
+  ],
+  'conditions': [
+    ['USE_test == 1', {
+      'targets': [
+        {
+          'target_name': 'buffet_testrunner',
+          'type': 'executable',
+          'dependencies': [
+            'buffet_common',
+          ],
+          'includes': ['../common-mk/common_test.gypi'],
+          'sources': [
+            'any_unittest.cc',
+            'any_internal_impl_unittest.cc',
+            'buffet_testrunner.cc',
+            'commands/command_definition_unittest.cc',
+            'commands/command_dictionary_unittest.cc',
+            'commands/command_instance_unittest.cc',
+            'commands/command_manager_unittest.cc',
+            'commands/command_queue_unittest.cc',
+            'commands/object_schema_unittest.cc',
+            'commands/schema_utils_unittest.cc',
+            'commands/unittest_utils.cc',
+            'data_encoding_unittest.cc',
+            'device_registration_info_unittest.cc',
+            'error_unittest.cc',
+            'exported_object_manager_unittest.cc',
+            'http_connection_fake.cc',
+            'http_transport_fake.cc',
+            'http_utils_unittest.cc',
+            'mime_utils_unittest.cc',
+            'string_utils_unittest.cc',
+            'url_utils_unittest.cc'
+          ],
+        },
       ],
-      'includes': ['../common-mk/common_test.gypi'],
-      'sources': [
-        'any_unittest.cc',
-        'any_internal_impl_unittest.cc',
-        'buffet_testrunner.cc',
-        'commands/command_definition_unittest.cc',
-        'commands/command_dictionary_unittest.cc',
-        'commands/command_instance_unittest.cc',
-        'commands/command_manager_unittest.cc',
-        'commands/command_queue_unittest.cc',
-        'commands/object_schema_unittest.cc',
-        'commands/schema_utils_unittest.cc',
-        'commands/unittest_utils.cc',
-        'data_encoding_unittest.cc',
-        'device_registration_info_unittest.cc',
-        'error_unittest.cc',
-        'exported_object_manager_unittest.cc',
-        'http_connection_fake.cc',
-        'http_transport_fake.cc',
-        'http_utils_unittest.cc',
-        'mime_utils_unittest.cc',
-        'string_utils_unittest.cc',
-        'url_utils_unittest.cc'
-      ],
-    },
+    }],
   ],
 }