[PATCH 1 of 8] tests: stabilize on Windows

Matt Harbison mharbison72 at gmail.com
Sun Jul 9 01:10:59 UTC 2017


# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1499537410 14400
#      Sat Jul 08 14:10:10 2017 -0400
# Node ID de324547c7516921c88af18cf7549cc597b32267
# Parent  4672db164c986da4442bd864cd044512d975c3f2
tests: stabilize on Windows

I'm not sure if the difference on Windows for test-sparse.t is expected or not.
It looks like unless the leading '/' is followed by a drive letter, '/' is
resolved to 'C:/MinGW/msys/1.0'.  But both cases abort with "not under root"
instead of just warning.

diff --git a/tests/test-rebase-scenario-global.t b/tests/test-rebase-scenario-global.t
--- a/tests/test-rebase-scenario-global.t
+++ b/tests/test-rebase-scenario-global.t
@@ -773,7 +773,7 @@
   $ hg rebase -b . -d 1 --traceback
   rebasing 2:779a07b1b7a0 "first source commit"
   rebasing 3:a7d6f3a00bf3 "second source with subdir" (tip)
-  saved backup bundle to $TESTTMP/cwd-vanish/.hg/strip-backup/779a07b1b7a0-853e0073-backup.hg (glob)
+  saved backup bundle to $TESTTMP/cwd-vanish/.hg/strip-backup/779a07b1b7a0-853e0073-rebase.hg (glob)
 #endif
 
 Get back to the root of cwd-vanish. Note that even though `cd ..`
diff --git a/tests/test-sparse-profiles.t b/tests/test-sparse-profiles.t
--- a/tests/test-sparse-profiles.t
+++ b/tests/test-sparse-profiles.t
@@ -246,6 +246,8 @@
 
   $ cd ..
 
+#if unix-permissions
+
 Test file permissions changing across a sparse profile change
   $ hg init sparseperm
   $ cd sparseperm
@@ -270,3 +272,4 @@
   $ ls -l b
   -rwxr-xr-x* b (glob)
 
+#endif
diff --git a/tests/test-sparse.t b/tests/test-sparse.t
--- a/tests/test-sparse.t
+++ b/tests/test-sparse.t
@@ -27,12 +27,24 @@
 
 Absolute paths outside the repo should just be rejected
 
+#if no-windows
   $ hg debugsparse --include /foo/bar
   warning: paths cannot start with /, ignoring: ['/foo/bar']
   $ hg debugsparse --include '$TESTTMP/myrepo/hide'
 
   $ hg debugsparse --include '/root'
   warning: paths cannot start with /, ignoring: ['/root']
+#else
+TODO: See if this can be made to fail the same way as on Unix
+  $ hg debugsparse --include /c/foo/bar
+  abort: c:/foo/bar not under root '$TESTTMP/myrepo' (glob)
+  [255]
+  $ hg debugsparse --include '$TESTTMP/myrepo/hide'
+
+  $ hg debugsparse --include '/c/root'
+  abort: c:/root not under root '$TESTTMP/myrepo' (glob)
+  [255]
+#endif
 
 Verify commiting while sparse includes other files
 


More information about the Mercurial-devel mailing list