changeset 16908:6a997aacba5d

tests: convert some 'hghave symlink' to #if This will enable some tests for windows.
author Mads Kiilerich <mads@kiilerich.com>
date Sun, 10 Jun 2012 18:50:42 +0200
parents 91dc9587862e
children b6fd2f8909ff
files tests/test-audit-path.t tests/test-keyword.t tests/test-largefiles.t tests/test-lfconvert.t
diffstat 4 files changed, 42 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-audit-path.t	Sun Jun 10 18:50:42 2012 +0200
+++ b/tests/test-audit-path.t	Sun Jun 10 18:50:42 2012 +0200
@@ -1,28 +1,24 @@
-  $ "$TESTDIR/hghave" symlink || exit 80
-
   $ hg init
 
-should fail
+audit of .hg
 
   $ hg add .hg/00changelog.i
   abort: path contains illegal component: .hg/00changelog.i (glob)
   [255]
 
+#if symlink
+
+Symlinks
+
   $ mkdir a
   $ echo a > a/a
   $ hg ci -Ama
   adding a/a
   $ ln -s a b
   $ echo b > a/b
-
-should fail
-
   $ hg add b/b
   abort: path 'b/b' traverses symbolic link 'b' (glob)
   [255]
-
-should succeed
-
   $ hg add b
 
 should still fail - maybe
@@ -31,6 +27,9 @@
   abort: path 'b/b' traverses symbolic link 'b' (glob)
   [255]
 
+#endif
+
+
 unbundle tampered bundle
 
   $ hg init target
@@ -47,7 +46,7 @@
   $ hg manifest -r0
   .hg/test
   $ hg update -Cr0
-  abort: path contains illegal component: .hg/test
+  abort: path contains illegal component: .hg/test (glob)
   [255]
 
 attack foo/.hg/test
@@ -55,7 +54,7 @@
   $ hg manifest -r1
   foo/.hg/test
   $ hg update -Cr1
-  abort: path 'foo/.hg/test' is inside nested repo 'foo'
+  abort: path 'foo/.hg/test' is inside nested repo 'foo' (glob)
   [255]
 
 attack back/test where back symlinks to ..
@@ -63,16 +62,23 @@
   $ hg manifest -r2
   back
   back/test
+#if symlink
   $ hg update -Cr2
   abort: path 'back/test' traverses symbolic link 'back'
   [255]
+#else
+('back' will be a file and cause some other system specific error)
+  $ hg update -Cr2
+  abort: * (glob)
+  [255]
+#endif
 
 attack ../test
 
   $ hg manifest -r3
   ../test
   $ hg update -Cr3
-  abort: path contains illegal component: ../test
+  abort: path contains illegal component: ../test (glob)
   [255]
 
 attack /tmp/test
--- a/tests/test-keyword.t	Sun Jun 10 18:50:42 2012 +0200
+++ b/tests/test-keyword.t	Sun Jun 10 18:50:42 2012 +0200
@@ -1,4 +1,4 @@
-  $ "$TESTDIR/hghave" symlink unix-permissions serve || exit 80
+  $ "$TESTDIR/hghave" unix-permissions serve || exit 80
 
   $ cat <<EOF >> $HGRCPATH
   > [extensions]
@@ -658,6 +658,8 @@
   $ hg update --clean
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
+#if symlink
+
 cp symlink file; hg cp -A symlink file (part2)
 - copied symlink points to kw ignored file: do not overwrite
 
@@ -679,6 +681,8 @@
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ rm i symignored
 
+#endif
+
 Custom keywordmaps as argument to kwdemo
 
   $ hg --quiet kwdemo "Xinfo = {author}: {desc}"
--- a/tests/test-largefiles.t	Sun Jun 10 18:50:42 2012 +0200
+++ b/tests/test-largefiles.t	Sun Jun 10 18:50:42 2012 +0200
@@ -1,4 +1,4 @@
-  $ "$TESTDIR/hghave" symlink unix-permissions serve || exit 80
+  $ "$TESTDIR/hghave" unix-permissions serve || exit 80
   $ USERCACHE=`pwd`/cache; export USERCACHE
   $ mkdir -p ${USERCACHE}
   $ cat >> $HGRCPATH <<EOF
@@ -1051,6 +1051,8 @@
   $ chmod -R u+w alice/pubrepo
   $ HOME="$ORIGHOME"
 
+#if symlink
+
 Symlink to a large largefile should behave the same as a symlink to a normal file
   $ hg init largesymlink
   $ cd largesymlink
@@ -1076,6 +1078,8 @@
   $ test -L largelink
   $ cd ..
 
+#endif
+
 test for pattern matching on 'hg status':
 to boost performance, largefiles checks whether specified patterns are
 related to largefiles in working directory (NOT to STANDIN) or not.
--- a/tests/test-lfconvert.t	Sun Jun 10 18:50:42 2012 +0200
+++ b/tests/test-lfconvert.t	Sun Jun 10 18:50:42 2012 +0200
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" symlink || exit 80
-
   $ cat >> $HGRCPATH <<EOF
   > [extensions]
   > largefiles =
@@ -33,6 +31,7 @@
   adding sub/normal2
   $ hg commit -m"add large, normal1" large normal1
   $ hg commit -m"add sub/*" sub
+
 Test tag parsing
   $ cat >> .hgtags <<EOF
   > IncorrectlyFormattedTag!
@@ -41,10 +40,8 @@
   > EOF
   $ hg add .hgtags
   $ hg commit -m"add large2" large2 .hgtags
-  $ hg rename large2 large3
+
 Test link+rename largefile codepath
-  $ ln -sf large large3
-  $ hg commit -m"make large2 a symlink" large2 large3
   $ [ -d .hg/largefiles ] && echo fail || echo pass
   pass
   $ cd ..
@@ -53,13 +50,24 @@
   skipping incorrectly formatted tag IncorrectlyFormattedTag!
   skipping incorrectly formatted id invalidhash
   no mapping for id 0123456789abcdef
+#if symlink
+  $ hg --cwd bigfile-repo rename large2 large3
+  $ ln -sf large bigfile-repo/large3
+  $ hg --cwd bigfile-repo commit -m"make large2 a symlink" large2 large3
+  $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo-symlink
+  initializing destination largefiles-repo-symlink
+  skipping incorrectly formatted tag IncorrectlyFormattedTag!
+  skipping incorrectly formatted id invalidhash
+  no mapping for id 0123456789abcdef
   abort: renamed/copied largefile large3 becomes symlink
   [255]
+#endif
   $ cd bigfile-repo
   $ hg strip --no-backup 2
   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
   $ cd ..
-  $ rm -rf largefiles-repo
+  $ rm -rf largefiles-repo largefiles-repo-symlink
+
   $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo
   initializing destination largefiles-repo