tests: convert some hghave unix-permissions to #if
authorMads Kiilerich <mads@kiilerich.com>
Tue, 19 Jun 2012 01:43:41 +0200
changeset 16986 79902f7e27df
parent 16985 40c9aa702303
child 16987 54295c87eefc
tests: convert some hghave unix-permissions to #if
tests/test-convert.t
tests/test-eol.t
tests/test-largefiles-cache.t
tests/test-largefiles.t
--- a/tests/test-convert.t	Tue Jun 19 00:20:38 2012 +0200
+++ b/tests/test-convert.t	Tue Jun 19 01:43:41 2012 +0200
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" unix-permissions || exit 80
-
   $ cat >> $HGRCPATH <<EOF
   > [extensions]
   > convert=
@@ -293,24 +291,27 @@
   pulling from ../a
   searching for changes
   no changes found
-  $ touch bogusfile
 
-should fail
+conversion to existing file should fail
 
+  $ touch bogusfile
   $ hg convert a bogusfile
   initializing destination bogusfile repository
   abort: cannot create new bundle repository
   [255]
+
+#if unix-permissions
+
+conversion to dir without permissions should fail
+
   $ mkdir bogusdir
   $ chmod 000 bogusdir
 
-should fail
-
   $ hg convert a bogusdir
   abort: Permission denied: bogusdir
   [255]
 
-should succeed
+user permissions should succeed
 
   $ chmod 700 bogusdir
   $ hg convert a bogusdir
@@ -324,6 +325,8 @@
   1 d
   0 e
 
+#endif
+
 test pre and post conversion actions
 
   $ echo 'include b' > filemap
--- a/tests/test-eol.t	Tue Jun 19 00:20:38 2012 +0200
+++ b/tests/test-eol.t	Tue Jun 19 01:43:41 2012 +0200
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" unix-permissions || exit 80
-
 Test EOL extension
 
   $ cat >> $HGRCPATH <<EOF
@@ -386,10 +384,13 @@
   % hg status
   $ rm -r mixed
 
+  $ echo '[extensions]' >> $HGRCPATH
+  $ echo 'eol =' >> $HGRCPATH
+
+#if unix-permissions
+
 Test issue2569 -- eol extension takes write lock on reading:
 
-  $ echo '[extensions]' >> $HGRCPATH
-  $ echo 'eol =' >> $HGRCPATH
   $ hg init repo
   $ cd repo
   $ touch .hgeol
@@ -403,6 +404,8 @@
   $ chmod -R u+w .hg
   $ cd ..
 
+#endif
+
 Test cleverencode: and cleverdecode: aliases for win32text extension
 
   $ echo '[encode]' >> $HGRCPATH
--- a/tests/test-largefiles-cache.t	Tue Jun 19 00:20:38 2012 +0200
+++ b/tests/test-largefiles-cache.t	Tue Jun 19 01:43:41 2012 +0200
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" unix-permissions || exit 80
-
 Create user cache directory
 
   $ USERCACHE=`pwd`/cache; export USERCACHE
@@ -72,10 +70,12 @@
   0 largefiles updated, 0 removed
   $ hg status
   ! large
+  $ cd ..
+
+#if unix-permissions
 
 Portable way to print file permissions:
 
-  $ cd ..
   $ cat > ls-l.py <<EOF
   > #!/usr/bin/env python
   > import sys, os
@@ -121,3 +121,5 @@
   640
 
   $ cd ..
+
+#endif
--- a/tests/test-largefiles.t	Tue Jun 19 00:20:38 2012 +0200
+++ b/tests/test-largefiles.t	Tue Jun 19 01:43:41 2012 +0200
@@ -1,4 +1,4 @@
-  $ "$TESTDIR/hghave" unix-permissions serve || exit 80
+  $ "$TESTDIR/hghave" serve || exit 80
   $ USERCACHE=`pwd`/cache; export USERCACHE
   $ mkdir -p ${USERCACHE}
   $ cat >> $HGRCPATH <<EOF
@@ -1018,6 +1018,8 @@
 used all HGPORTs, kill all daemons
   $ "$TESTDIR/killdaemons.py"
 
+#if unix-permissions
+
 Clone a local repository owned by another user
 We have to simulate that here by setting $HOME and removing write permissions
   $ ORIGHOME="$HOME"
@@ -1051,6 +1053,8 @@
   $ chmod -R u+w alice/pubrepo
   $ HOME="$ORIGHOME"
 
+#endif
+
 #if symlink
 
 Symlink to a large largefile should behave the same as a symlink to a normal file