From 644362cf86a1b46f85e56c888cf2fd75eb9fb001 Mon Sep 17 00:00:00 2001
From: "apatrick@chromium.org"
 <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Mon, 29 Mar 2010 23:18:12 +0000
Subject: [PATCH] Added GPU unit tests to win, mac and linux builds. They
 aren't running yet. TEST=trybots BUG=none

Review URL: http://codereview.chromium.org/1577001

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43013 0039d316-1c4b-4281-b951-d872f2087c98
---
 build/all.gyp |   7 ++-
 gpu/gpu.gyp   | 148 ++++++++++++++++++++++----------------------------
 2 files changed, 71 insertions(+), 84 deletions(-)

diff --git a/build/all.gyp b/build/all.gyp
index 40913928e5b4f..31d4632c5660c 100644
--- a/build/all.gyp
+++ b/build/all.gyp
@@ -13,6 +13,7 @@
         '../base/base.gyp:*',
         '../chrome/chrome.gyp:*',
         '../gfx/gfx.gyp:*',
+        '../gpu/gpu.gyp:*',
         '../ipc/ipc.gyp:*',
         '../media/media.gyp:*',
         '../net/net.gyp:*',
@@ -93,7 +94,6 @@
             '../courgette/courgette.gyp:*',
             '../gears/gears.gyp:*',
             '../gpu/demos/demos.gyp:*',
-            '../gpu/gpu.gyp:*',
             '../rlz/rlz.gyp:*',
             '../sandbox/sandbox.gyp:*',
             '../third_party/bsdiff/bsdiff.gyp:*',
@@ -140,7 +140,8 @@
           'dependencies': [
             '../app/app.gyp:app_unittests',
             '../gfx/gfx.gyp:gfx_unittests',
-            '../ipc/ipc.gyp:ipc_tests',
+            '../gpu/gpu.gyp:gpu_unittests',
+             '../ipc/ipc.gyp:ipc_tests',
             '../media/media.gyp:media_unittests',
             '../printing/printing.gyp:printing_unittests',
             '../chrome/chrome.gyp:browser_tests',
@@ -165,6 +166,7 @@
             '../chrome/chrome.gyp:unit_tests',
             '../chrome/chrome.gyp:url_fetch_test',
             '../gfx/gfx.gyp:gfx_unittests',
+            '../gpu/gpu.gyp:gpu_unittests',
             '../ipc/ipc.gyp:ipc_tests',
             '../media/media.gyp:media_unittests',
             '../printing/printing.gyp:printing_unittests',
@@ -214,6 +216,7 @@
             '../chrome/installer/mini_installer.gyp:chrome_frame_mini_installer',
             '../courgette/courgette.gyp:courgette_unittests',
             '../gfx/gfx.gyp:gfx_unittests',
+            '../gpu/gpu.gyp:gpu_unittests',
             '../ipc/ipc.gyp:ipc_tests',
             '../media/media.gyp:media_unittests',
             '../printing/printing.gyp:printing_unittests',
diff --git a/gpu/gpu.gyp b/gpu/gpu.gyp
index 06818fc8ae4ad..86c79ff8e777a 100644
--- a/gpu/gpu.gyp
+++ b/gpu/gpu.gyp
@@ -8,7 +8,7 @@
     # This is defined here because we need to compile this set of files
     # twice with different defines. Once so it calls real GL, again so it
     # calls mock GL for the unit tests.
-    'gpu_source_files': [
+    'gpu_service_source_files': [
       'command_buffer/service/buffer_manager.h',
       'command_buffer/service/buffer_manager.cc',
       'command_buffer/service/framebuffer_manager.h',
@@ -66,29 +66,35 @@
               'ldflags': [
                 '-L<(PRODUCT_DIR)',
               ],
-              'libraries': [
-                '-lX11',
-                # For dlsym() in '../third_party/glew/src/glew.c'
-                '-ldl',
-              ],
+              'link_settings': {
+                'libraries': [
+                  '-lX11',
+                  # For dlsym() in '../third_party/glew/src/glew.c'
+                  '-ldl',
+                ],
+              },
             },
           },
         ],
         [ 'OS=="mac"',
           {
-            'direct_dependent_settings': {
-              'libraries': [
-                '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',
-              ],
+            'all_dependent_settings': {
+              'link_settings': {
+                'libraries': [
+                  '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',
+                ],
+              },
             },
           },
         ],
         [ 'OS=="win"',
           {
             'all_dependent_settings': {
-              'libraries': [
-                '-lOpenGL32.lib',
-              ],
+              'link_settings': {
+                'libraries': [
+                  '-lOpenGL32.lib',
+                ],
+              },
             },
           },
         ],
@@ -190,23 +196,6 @@
         'command_buffer/client/gles2_c_lib_autogen.h',
       ],
     },
-    {
-      'target_name': 'command_buffer_common_unittests',
-      'type': 'none',
-      'include_dirs': [
-        '.',
-      ],
-      'dependencies': [
-        'gles2_lib',
-        'gles2_implementation',
-        'gles2_cmd_helper',
-      ],
-      'direct_dependent_settings': {
-        'sources': [
-          'command_buffer/common/bitfield_helpers_test.cc',
-        ],
-      },
-    },
     {
       'target_name': 'command_buffer_client',
       'type': 'static_library',
@@ -222,17 +211,6 @@
         'command_buffer/client/id_allocator.h',
       ],
     },
-    {
-      'target_name': 'command_buffer_client_unittests',
-      'type': 'none',
-      'direct_dependent_settings': {
-        'sources': [
-          'command_buffer/client/cmd_buffer_helper_test.cc',
-          'command_buffer/client/fenced_allocator_test.cc',
-          'command_buffer/client/id_allocator_test.cc',
-        ],
-      },
-    },
     {
       'target_name': 'command_buffer_service_impl',
       'type': 'static_library',
@@ -309,45 +287,9 @@
         'gl_libs',
       ],
       'sources': [
-        '<@(gpu_source_files)',
+        '<@(gpu_service_source_files)',
       ],
     },
-    {
-      'target_name': 'command_buffer_service_unittests',
-      'type': 'none',
-      'direct_dependent_settings': {
-        'sources': [
-          '<@(gpu_source_files)',
-          'command_buffer/common/gles2_cmd_format_test.cc',
-          'command_buffer/common/gles2_cmd_format_test_autogen.h',
-          'command_buffer/common/gles2_cmd_id_test.cc',
-          'command_buffer/common/gles2_cmd_id_test_autogen.h',
-          'command_buffer/service/buffer_manager_unittest.cc',
-          'command_buffer/service/context_group_unittest.cc',
-          'command_buffer/service/cmd_parser_test.cc',
-          'command_buffer/service/cmd_parser_test.cc',
-          'command_buffer/service/common_decoder_unittest.cc',
-          'command_buffer/service/framebuffer_manager_unittest.cc',
-          'command_buffer/service/gpu_processor_unittest.cc',
-          'command_buffer/service/gl_interface.h',
-          'command_buffer/service/gl_interface.cc',
-          'command_buffer/service/gl_mock.h',
-          'command_buffer/service/gl_mock.cc',
-          'command_buffer/service/gles2_cmd_decoder_unittest_base.h',
-          'command_buffer/service/gles2_cmd_decoder_unittest_base.cc',
-          'command_buffer/service/gles2_cmd_decoder_unittest.cc',
-          'command_buffer/service/gles2_cmd_decoder_unittest_1.cc',
-          'command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h',
-          'command_buffer/service/gles2_cmd_decoder_unittest_2.cc',
-          'command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h',
-          'command_buffer/service/id_manager_unittest.cc',
-          'command_buffer/service/program_manager_unittest.cc',
-          'command_buffer/service/renderbuffer_manager_unittest.cc',
-          'command_buffer/service/shader_manager_unittest.cc',
-          'command_buffer/service/texture_manager_unittest.cc',
-        ],
-      },
-    },
     {
       'target_name': 'gpu_plugin',
       'type': 'static_library',
@@ -369,18 +311,60 @@
       ],
     },
     {
-      'target_name': 'gpu_all_unittests',
+      'target_name': 'gpu_unittests',
       'type': 'executable',
       'dependencies': [
         '../testing/gmock.gyp:gmock',
         '../testing/gmock.gyp:gmockmain',
         '../testing/gtest.gyp:gtest',
         'command_buffer_client',
-        'command_buffer_client_unittests',
         'command_buffer_common',
-        'command_buffer_common_unittests',
         'command_buffer_service_impl',
-        'command_buffer_service_unittests',
+        'gles2_lib',
+        'gles2_implementation',
+        'gles2_cmd_helper',
+      ],
+      'sources': [
+        '<@(gpu_service_source_files)',
+        'command_buffer/client/cmd_buffer_helper_test.cc',
+        'command_buffer/client/fenced_allocator_test.cc',
+        'command_buffer/client/id_allocator_test.cc',
+        'command_buffer/common/bitfield_helpers_test.cc',
+        'command_buffer/common/gles2_cmd_format_test.cc',
+        'command_buffer/common/gles2_cmd_format_test_autogen.h',
+        'command_buffer/common/gles2_cmd_id_test.cc',
+        'command_buffer/common/gles2_cmd_id_test_autogen.h',
+        'command_buffer/common/gles2_cmd_format_test.cc',
+        'command_buffer/common/gles2_cmd_format_test_autogen.h',
+        'command_buffer/common/gles2_cmd_id_test.cc',
+        'command_buffer/common/gles2_cmd_id_test_autogen.h',
+        'command_buffer/common/gles2_cmd_format_test.cc',
+        'command_buffer/common/gles2_cmd_format_test_autogen.h',
+        'command_buffer/common/gles2_cmd_id_test.cc',
+        'command_buffer/common/gles2_cmd_id_test_autogen.h',
+        'command_buffer/service/buffer_manager_unittest.cc',
+        'command_buffer/service/context_group_unittest.cc',
+        'command_buffer/service/cmd_parser_test.cc',
+        'command_buffer/service/cmd_parser_test.cc',
+        'command_buffer/service/common_decoder_unittest.cc',
+        'command_buffer/service/framebuffer_manager_unittest.cc',
+        'command_buffer/service/gpu_processor_unittest.cc',
+        'command_buffer/service/gl_interface.h',
+        'command_buffer/service/gl_interface.cc',
+        'command_buffer/service/gl_mock.h',
+        'command_buffer/service/gl_mock.cc',
+        'command_buffer/service/gles2_cmd_decoder_unittest_base.h',
+        'command_buffer/service/gles2_cmd_decoder_unittest_base.cc',
+        'command_buffer/service/gles2_cmd_decoder_unittest.cc',
+        'command_buffer/service/gles2_cmd_decoder_unittest_1.cc',
+        'command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h',
+        'command_buffer/service/gles2_cmd_decoder_unittest_2.cc',
+        'command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h',
+        'command_buffer/service/id_manager_unittest.cc',
+        'command_buffer/service/program_manager_unittest.cc',
+        'command_buffer/service/renderbuffer_manager_unittest.cc',
+        'command_buffer/service/shader_manager_unittest.cc',
+        'command_buffer/service/texture_manager_unittest.cc',
       ],
     },
     {
-- 
GitLab