Bug 1216721 - Only get the symbolizer path for ASan for ASan builds. r=chmanchester
authorAndrew McCreight <continuation@gmail.com>
Thu, 22 Oct 2015 09:33:43 -0700
changeset 268995 b5fc7e286929c74bb3e4d2a9cd8d6d9b36b97356
parent 268994 97c0692a9ce5336fb5579aa52581fba8eb79c32a
child 268996 08a76850aef182640f1f06bb73af10f9b01cabe8
push idunknown
push userunknown
push dateunknown
reviewerschmanchester
bugs1216721
milestone44.0a1
Bug 1216721 - Only get the symbolizer path for ASan for ASan builds. r=chmanchester
testing/runcppunittests.py
--- a/testing/runcppunittests.py
+++ b/testing/runcppunittests.py
@@ -116,23 +116,24 @@ class CPPUnitTests(object):
         elif mozinfo.os == "win":
             pathvar = "PATH"
         if pathvar:
             if pathvar in env:
                 env[pathvar] = "%s%s%s" % (libpath, os.pathsep, env[pathvar])
             else:
                 env[pathvar] = libpath
 
-        # Use llvm-symbolizer for ASan if available/required
-        llvmsym = os.path.join(self.xre_path, "llvm-symbolizer")
-        if os.path.isfile(llvmsym):
-            env["ASAN_SYMBOLIZER_PATH"] = llvmsym
-            self.log.info("ASan using symbolizer at %s" % llvmsym)
-        else:
-            self.log.info("Failed to find ASan symbolizer at %s" % llvmsym)
+        if mozinfo.info["asan"]:
+            # Use llvm-symbolizer for ASan if available/required
+            llvmsym = os.path.join(self.xre_path, "llvm-symbolizer")
+            if os.path.isfile(llvmsym):
+                env["ASAN_SYMBOLIZER_PATH"] = llvmsym
+                self.log.info("ASan using symbolizer at %s" % llvmsym)
+            else:
+                self.log.info("Failed to find ASan symbolizer at %s" % llvmsym)
 
         return env
 
     def run_tests(self, programs, xre_path, symbols_path=None, interactive=False):
         """
         Run a set of C++ unit test programs.
 
         Arguments: