Bug 615975 - Switch to the manifest directory before running a test in a debugger. r=dmandelin
authorJeff Walden <jwalden@mit.edu>
Thu, 02 Dec 2010 12:35:21 -0800
changeset 58708 e0384935eb1a64325bdcb80e9a18891ff1ba73c1
parent 58707 651d80c9ad153a4941d10d2e4f9ae02119d11215
child 58709 7c2cbf2651d29768b6943827325a734bfa201f93
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewersdmandelin
bugs615975
milestone2.0b8pre
Bug 615975 - Switch to the manifest directory before running a test in a debugger. r=dmandelin
js/src/tests/jstests.py
--- a/js/src/tests/jstests.py
+++ b/js/src/tests/jstests.py
@@ -320,16 +320,19 @@ if __name__ == '__main__':
             print('Multiple tests match command line arguments, debugger can only run one')
             for tc in test_list:
                 print('    %s'%tc.path)
             sys.exit(2)
 
         cmd = test_list[0].get_command(TestTask.js_cmd_prefix)
         if OPTIONS.show_cmd:
             print subprocess.list2cmdline(cmd)
+        manifest_dir = os.path.dirname(OPTIONS.manifest)
+        if manifest_dir not in ('', '.'):
+            os.chdir(os.path.dirname(OPTIONS.manifest))
         call(cmd)
         sys.exit()
 
     if not test_list:
         print 'no tests selected'
     else:
         curdir = os.getcwd()
         manifest_dir = os.path.dirname(OPTIONS.manifest)