changeset 18765:cd2c82510aa2

tests: fix test-profile to not depend on HGPROF environment variable The test-profile test would fail if the user had HGPROF set to another profiler in their environment. This fix makes the test independent of that environment variable. Reverts the previous attempt to fix this, which was not cross platoform.
author Durham Goode <durham@fb.com>
date Tue, 12 Mar 2013 10:37:48 -0700
parents 249b6b455e9b
children 64b5562550e2
files tests/run-tests.py tests/test-profile.t
diffstat 2 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Tue Mar 12 10:43:59 2013 -0700
+++ b/tests/run-tests.py	Tue Mar 12 10:37:48 2013 -0700
@@ -1277,6 +1277,9 @@
         # can't remove on solaris
         os.environ['HG'] = ''
         del os.environ['HG']
+    if 'HGPROF' in os.environ:
+        os.environ['HGPROF'] = ''
+        del os.environ['HGPROF']
 
     global TESTDIR, HGTMP, INST, BINDIR, PYTHONDIR, COVERAGE_FILE
     TESTDIR = os.environ["TESTDIR"] = os.getcwd()
--- a/tests/test-profile.t	Tue Mar 12 10:43:59 2013 -0700
+++ b/tests/test-profile.t	Tue Mar 12 10:37:48 2013 -0700
@@ -8,8 +8,6 @@
 
 test --profile
 
-  $ export -n HGPROF
-
   $ hg --profile st 2>../out
   $ grep CallCount ../out > /dev/null || cat ../out