[go: nahoru, domu]

Do not use nm to check that Valgrind-OSX is used on instrumented binaries.
Nobody's supposed to run Valgrind on OSX locally, and the check is pointless
(and does not work) on the bots running OSX 10.6

BUG=none
R=timurrrr@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/721153002

Cr-Commit-Position: refs/heads/master@{#304015}
diff --git a/tools/valgrind/chrome_tests.py b/tools/valgrind/chrome_tests.py
index 8735e0d..27d554e 100755
--- a/tools/valgrind/chrome_tests.py
+++ b/tools/valgrind/chrome_tests.py
@@ -129,11 +129,14 @@
       # TODO(timurrrr): also check TSan and MSan?
       # `nm` might not be available, so use try-except.
       try:
-        nm_output = subprocess.check_output(["nm", exe_path])
-        if nm_output.find("__asan_init") != -1:
-          raise BadBinary("You're trying to run an executable instrumented "
-                          "with AddressSanitizer under %s. Please provide "
-                          "an uninstrumented executable." % tool_name)
+        # Do not perform this check on OS X, as 'nm' on 10.6 can't handle
+        # binaries built with Clang 3.5+.
+        if not common.IsMac():
+          nm_output = subprocess.check_output(["nm", exe_path])
+          if nm_output.find("__asan_init") != -1:
+            raise BadBinary("You're trying to run an executable instrumented "
+                            "with AddressSanitizer under %s. Please provide "
+                            "an uninstrumented executable." % tool_name)
       except OSError:
         pass