tests: change odd uses of 'if hghave' to #if
authorMads Kiilerich <mads@kiilerich.com>
Sun, 10 Jun 2012 13:01:40 +0200
changeset 16898 bb91c602d4ad
parent 16897 2774576dee4d
child 16899 8149ff405c78
tests: change odd uses of 'if hghave' to #if
tests/test-clone.t
tests/test-import-git.t
tests/test-profile.t
tests/test-subrepo-svn.t
--- a/tests/test-clone.t	Sun Jun 10 03:05:59 2012 +0200
+++ b/tests/test-clone.t	Sun Jun 10 13:01:40 2012 +0200
@@ -503,16 +503,17 @@
 #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
 
--- a/tests/test-import-git.t	Sun Jun 10 03:05:59 2012 +0200
+++ b/tests/test-import-git.t	Sun Jun 10 13:01:40 2012 +0200
@@ -65,12 +65,13 @@
   $ 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
--- a/tests/test-profile.t	Sun Jun 10 03:05:59 2012 +0200
+++ b/tests/test-profile.t	Sun Jun 10 13:01:40 2012 +0200
@@ -4,28 +4,26 @@
   $ 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
--- a/tests/test-subrepo-svn.t	Sun Jun 10 03:05:59 2012 +0200
+++ b/tests/test-subrepo-svn.t	Sun Jun 10 13:01:40 2012 +0200
@@ -456,9 +456,7 @@
   
   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: