Add a check for the test driver to make sure that, on Mac OS X, the automatic lookup and caching
of dSYMs is not turned on before running the test suite.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139896 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/dotest.py b/test/dotest.py
index 97c56ab..a2539bc 100755
--- a/test/dotest.py
+++ b/test/dotest.py
@@ -21,6 +21,7 @@
 """
 
 import os, signal, sys, time
+import subprocess
 import unittest2
 
 def is_exe(fpath):
@@ -618,7 +619,6 @@
         #print "The 'lldb' executable path is", lldbExec
         os.system('%s -v' % lldbExec)
     
-    import subprocess
     if os.path.isdir(os.path.join(base, '.svn')):
         pipe = subprocess.Popen(["svn", "info", base], stdout = subprocess.PIPE)
         svn_info = pipe.stdout.read()
@@ -784,7 +784,6 @@
             raise Exception('log enable failed (check GDB_REMOTE_LOG env variable.')
 
 def getMyCommandLine():
-    import subprocess
     ps = subprocess.Popen(['ps', '-o', "command=CMD", str(os.getpid())], stdout=subprocess.PIPE).communicate()[0]
     lines = ps.split('\n')
     cmd_line = lines[1]
@@ -796,6 +795,21 @@
 #                                          #
 # ======================================== #
 
+def checkDsymForUUIDIsNotOn():
+    pipe = subprocess.Popen(["defaults", "read", "com.apple.DebugSymbols"], stdout = subprocess.PIPE)
+    debug_symbols_output = pipe.stdout.read()
+    if "DBGFileMappedPaths = " in debug_symbols_output:
+        print "defaults read com.apple.DebugSysmbols =>"
+        print debug_symbols_output
+        print "Disable automatic lookup and caching of dSYMs before running the test suite!"
+        print "Exiting..."
+        sys.exit(0)
+
+# On MacOS X, check to make sure that domain for com.apple.DebugSymbols defaults
+# does not exist before proceeding to running the test suite.
+if sys.platform.startswith("darwin"):
+    checkDsymForUUIDIsNotOn()
+
 #
 # Start the actions by first parsing the options while setting up the test
 # directories, followed by setting up the search paths for lldb utilities;
@@ -1079,7 +1093,6 @@
 # Terminate the test suite if ${LLDB_TESTSUITE_FORCE_FINISH} is defined.
 # This should not be necessary now.
 if ("LLDB_TESTSUITE_FORCE_FINISH" in os.environ):
-    import subprocess
     print "Terminating Test suite..."
     subprocess.Popen(["/bin/sh", "-c", "kill %s; exit 0" % (os.getpid())])