From patchwork Tue Mar 12 20:28:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: tests: fix test-profile to not depend on HGPROF environment variable From: Durham Goode X-Patchwork-Id: 1115 Message-Id: <609c71ae10616f533840.1363120120@dev350.prn1.facebook.com> To: mercurial-devel@selenic.com Date: Tue, 12 Mar 2013 13:28:40 -0700 # HG changeset patch # User Durham Goode # Date 1363109868 25200 # Tue Mar 12 10:37:48 2013 -0700 # Node ID 609c71ae10616f533840db8accf6ee9b2e420b7f # Parent a039d7868d8546d0f83d46f28e720890a6e9594a 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. diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -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() diff --git a/tests/test-profile.t b/tests/test-profile.t --- a/tests/test-profile.t +++ b/tests/test-profile.t @@ -8,8 +8,6 @@ test --profile - $ export -n HGPROF - $ hg --profile st 2>../out $ grep CallCount ../out > /dev/null || cat ../out