chromeos-config: Make test binary depend on USE=test

The test binary should not be built normally. Adjust the gyp file to make
it conditional on USE=test.

BUG=chromium:685490
TEST=emerge-reef chromeos-config-tools
with and without FEATURES=test

Change-Id: Ibcf524a4ef0f7786d5c09af0a2015aa12240212a
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/444450
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/chromeos-config/chromeos-config.gyp b/chromeos-config/chromeos-config.gyp
index 2d85bfe..3543c17 100644
--- a/chromeos-config/chromeos-config.gyp
+++ b/chromeos-config/chromeos-config.gyp
@@ -10,7 +10,6 @@
     {
       'target_name': 'libcros_config',
       'type': 'shared_library',
-      'includes': ['../common-mk/common_test.gypi'],
       'sources': [
         'libcros_config/cros_config.cc',
         'libcros_config/fake_cros_config.cc',
@@ -21,18 +20,25 @@
         ],
       },
     },
-    {
-      'target_name': 'cros_config_unittest',
-      'type': 'executable',
-      'include_dirs': [
-        'libcros_config',
+  ],
+  'conditions': [
+    ['USE_test == 1', {
+      'targets': [
+        {
+          'target_name': 'cros_config_unittest',
+          'type': 'executable',
+          'includes': ['../common-mk/common_test.gypi'],
+          'include_dirs': [
+            'libcros_config',
+          ],
+          'dependencies': [
+            'libcros_config',
+          ],
+          'sources': [
+            'libcros_config/cros_config_unittest.cc',
+          ],
+        },
       ],
-      'dependencies': [
-        'libcros_config',
-      ],
-      'sources': [
-        'libcros_config/cros_config_unittest.cc',
-      ],
-    },
+    }],
   ],
 }