Add support for shared library builds to tools/test-wrapper-gypbuild.py
authorjkummerow@chromium.org <jkummerow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 31 Aug 2011 14:15:42 +0000 (14:15 +0000)
committerjkummerow@chromium.org <jkummerow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 31 Aug 2011 14:15:42 +0000 (14:15 +0000)
by setting LD_LIBRARY_PATH as required

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9085 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

build/all.gyp
test/cctest/cctest.gyp
tools/test-wrapper-gypbuild.py

index 9c0f05c..b87b1c0 100644 (file)
         '../preparser/preparser.gyp:*',
         '../samples/samples.gyp:*',
         '../src/d8.gyp:d8',
-      ],
-      'conditions': [
-        [ 'component!="shared_library"', {
-          'dependencies': [
-            '../test/cctest/cctest.gyp:*',
-          ],
-        }]
+        '../test/cctest/cctest.gyp:*',
       ],
     }
   ]
index c0b5316..5d0cab3 100644 (file)
@@ -35,7 +35,6 @@
       'target_name': 'cctest',
       'type': 'executable',
       'dependencies': [
-        '../../tools/gyp/v8.gyp:v8',
         'resources',
       ],
       'include_dirs': [
             'test-platform-win32.cc',
           ],
         }],
+        ['component=="shared_library"', {
+          # cctest can't be built against a shared library, so we need to
+          # depend on the underlying static target in that case.
+          'conditions': [
+            ['v8_use_snapshot=="true"', {
+              'dependencies': ['../../tools/gyp/v8.gyp:v8_snapshot'],
+            },
+            {
+              'dependencies': ['../../tools/gyp/v8.gyp:v8_nosnapshot'],
+            }],
+          ],
+        }, {
+          'dependencies': ['../../tools/gyp/v8.gyp:v8'],
+        }],
       ],
     },
     {
index fdf8257..ad5449a 100755 (executable)
@@ -215,17 +215,21 @@ def Main():
   for arg in args:
     args_for_children += [arg]
   returncodes = 0
+  env = os.environ
 
   for mode in options.mode:
     for arch in options.arch:
       print ">>> running tests for %s.%s" % (arch, mode)
-      shell = workspace + '/' + options.outdir + '/' + arch + '.' + mode + "/d8"
+      shellpath = workspace + '/' + options.outdir + '/' + arch + '.' + mode
+      env['LD_LIBRARY_PATH'] = shellpath + '/lib.target'
+      shell = shellpath + "/d8"
       child = subprocess.Popen(' '.join(args_for_children +
                                         ['--arch=' + arch] +
                                         ['--mode=' + mode] +
                                         ['--shell=' + shell]),
                                shell=True,
-                               cwd=workspace)
+                               cwd=workspace,
+                               env=env)
       returncodes += child.wait()
 
   return returncodes