diff --git a/lldb/test/README-TestSuite b/lldb/test/README-TestSuite index ea3926ceed2b..53f3d74d359b 100644 --- a/lldb/test/README-TestSuite +++ b/lldb/test/README-TestSuite @@ -90,3 +90,12 @@ o dotest.pl suite become more reliable, we don't expect to be using 'dotest.pl' anymore. Note: dotest.pl has been moved to the attic directory. + +o Profiling dotest.py runs + + I used the following command line thingy to do the profiling on a SnowLeopard + machine: + +$ DOTEST_PROFILE=YES DOTEST_SCRIPT_DIR=/Volumes/data/lldb/svn/trunk/test /System/Library/Frameworks/Python.framework/Versions/Current/lib/python2.6/cProfile.py -o my.profile ./dotest.py -v -w 2> ~/Developer/Log/lldbtest.log + + After that, I used the pstats.py module to browse the statistics. diff --git a/lldb/test/dotest.py b/lldb/test/dotest.py index 5c6be195512d..578850c6edd6 100755 --- a/lldb/test/dotest.py +++ b/lldb/test/dotest.py @@ -439,7 +439,10 @@ def setupSysPath(): global testdirs # Get the directory containing the current script. - scriptPath = sys.path[0] + if "DOTEST_PROFILE" in os.environ and "DOTEST_SCRIPT_DIR" in os.environ: + scriptPath = os.environ["DOTEST_SCRIPT_DIR"] + else: + scriptPath = sys.path[0] if not scriptPath.endswith('test'): print "This script expects to reside in lldb's test directory." sys.exit(-1)