[PATCH] tests: fix test-profile to not depend on HGPROF environment variable

Mads Kiilerich mads at kiilerich.com
Tue Mar 12 12:50:45 CDT 2013


On 03/12/2013 06:39 PM, Durham Goode wrote:
> # HG changeset patch
> # User Durham Goode <durham at fb.com>
> # Date 1363109868 25200
> #      Tue Mar 12 10:37:48 2013 -0700
> # Node ID 549e74b13d1a8fd276685be136d795ba49f7fab3
> # Parent  018d68a30fe19e2d2c73d765306ba3156bb4957c
> 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.
>
> diff --git a/tests/test-profile.t b/tests/test-profile.t
> --- a/tests/test-profile.t
> +++ b/tests/test-profile.t
> @@ -8,6 +8,8 @@
>   
>   test --profile
>   
> +  $ export -n HGPROF

$ dash -c 'export -n HGPROF'
dash: 1: export: Illegal option -n

But this kind of stuff is usually done in run-tests.py main().

Actually it would have been reset automatically if HGPROF had followed 
the apparent convention and called HG_PROF. The variable is undocumented 
and could perhaps be considered an internal(?) implementation detail and 
renamed.

/Mads


More information about the Mercurial-devel mailing list