tests: change odd uses of 'if hghave' to #if

This commit is contained in:
Mads Kiilerich 2012-06-10 13:01:40 +02:00
parent cc8d5d2d8e
commit 1df3d48d73
4 changed files with 37 additions and 39 deletions

View File

@ -503,16 +503,17 @@ Inaccessible destination
#endif
#if fifo
Source of wrong type
$ if "$TESTDIR/hghave" -q fifo; then
> mkfifo a
> hg clone a b
> rm a
> else
> echo "abort: repository a not found!"
> fi
$ mkfifo a
$ hg clone a b
abort: repository a not found!
[255]
$ rm a
#endif
Default destination, same directory

View File

@ -65,12 +65,13 @@ Copy:
$ hg tip -q
3:37bacb7ca14d
$ if "$TESTDIR/hghave" -q execbit; then
> test -f copy -a ! -x copy || echo bad
> test -x copyx || echo bad
> else
> test -f copy || echo bad
> fi
#if execbit
$ test -f copy
$ test ! -x copy
$ test -x copyx
#else
$ test -f copy
#endif
$ cat copy
a

View File

@ -4,28 +4,26 @@ test --time
$ hg init a
$ cd a
#if lsprof
test --profile
$ if "$TESTDIR/hghave" -q lsprof; then
> hg --profile st 2>../out || echo --profile failed
> grep CallCount < ../out > /dev/null || echo wrong --profile
>
> hg --profile --config profiling.output=../out st 2>&1 \
> || echo --profile + output to file failed
> grep CallCount < ../out > /dev/null \
> || echo wrong --profile output when saving to a file
>
> hg --profile --config profiling.format=text st 2>&1 \
> | grep CallCount > /dev/null || echo --profile format=text failed
>
> echo "[profiling]" >> $HGRCPATH
> echo "format=kcachegrind" >> $HGRCPATH
>
> hg --profile st 2>../out || echo --profile format=kcachegrind failed
> grep 'events: Ticks' < ../out > /dev/null || echo --profile output is wrong
>
> hg --profile --config profiling.output=../out st 2>&1 \
> || echo --profile format=kcachegrind + output to file failed
> grep 'events: Ticks' < ../out > /dev/null \
> || echo --profile output is wrong
> fi
$ hg --profile st 2>../out
$ grep CallCount ../out > /dev/null || cat ../out
$ hg --profile --config profiling.output=../out st
$ grep CallCount ../out > /dev/null || cat ../out
$ hg --profile --config profiling.format=text st 2>../out
$ grep CallCount ../out > /dev/null || cat ../out
$ echo "[profiling]" >> $HGRCPATH
$ echo "format=kcachegrind" >> $HGRCPATH
$ hg --profile st 2>../out
$ grep 'events: Ticks' ../out > /dev/null || cat ../out
$ hg --profile --config profiling.output=../out st
$ grep 'events: Ticks' ../out > /dev/null || cat ../out
#endif

View File

@ -456,9 +456,7 @@ are unknown directories being replaced by tracked ones (happens with rebase).
Checked out revision 5.
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ if "$TESTDIR/hghave" -q svn15; then
> hg up 2 >/dev/null 2>&1 || echo update failed
> fi
$ hg up -q 2
Modify one of the externals to point to a different path so we can
test having obstructions when switching branches on checkout: