diff tests/test-commit.t @ 16842:a3ea092203a5

tests: introduce c-style conditional sections in .t tests This makes it possible to have conditional sections like: #if windows $ echo foo foo #else $ echo bar bar #endif The directives and skipped sections are treated like comments, so don't interleave them with commands and their output. The parameters to #if are evaluated while preparing the test by passing them over to hghave. Requirements can thus be negated with 'no-' prefix, and multiple requirements must all be true to return true.
author Mads Kiilerich <mads@kiilerich.com>
date Fri, 01 Jun 2012 02:25:12 +0200
parents 117f9190c1ba
children 928ee57e3aae
line wrap: on
line diff
--- a/tests/test-commit.t	Wed May 30 14:28:57 2012 +0200
+++ b/tests/test-commit.t	Fri Jun 01 02:25:12 2012 +0200
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" symlink || exit 80
-
 commit date test
 
   $ hg init test
@@ -75,10 +73,14 @@
   $ hg commit -m commit-14 does-not-exist
   abort: does-not-exist: * (glob)
   [255]
+
+#if symlink
   $ ln -s foo baz
   $ hg commit -m commit-15 baz
   abort: baz: file not tracked!
   [255]
+#endif
+
   $ touch quux
   $ hg commit -m commit-16 quux
   abort: quux: file not tracked!