# HG changeset patch # User Doug Simon # Date 1365709252 -7200 # Node ID 08a16c26907f211e934dbde10d3ad4d423c3822a # Parent 1eb16dbb31a7a564a870eecdb86a626613aee340 MX_TESTFILE environment variable can be used to specify (and preserve) the test list file used by 'mx unittest'. This is useful when wanting to run the command under gdb. diff -r 1eb16dbb31a7 -r 08a16c26907f mx/commands.py --- a/mx/commands.py Thu Apr 11 21:38:09 2013 +0200 +++ b/mx/commands.py Thu Apr 11 21:40:52 2013 +0200 @@ -777,7 +777,9 @@ name = 'JUnitWrapper' javaSource = join(mxdir, name + '.java') javaClass = join(mxdir, name + '.class') - (_, testfile) = tempfile.mkstemp(".testclasses", "graal") + testfile = os.environ.get('MX_TESTFILE', None) + if testfile is None: + (_, testfile) = tempfile.mkstemp(".testclasses", "graal") def harness(projectscp, vmArgs): if not exists(javaClass) or getmtime(javaClass) < getmtime(javaSource): @@ -791,7 +793,8 @@ try: _run_tests(args, harness, annotations, testfile) finally: - os.remove(testfile) + if os.environ.get('MX_TESTFILE') is None: + os.remove(testfile) def unittest(args): """run the JUnit tests (all testcases)