[PATCH 1 of 7 STABLE] run-tests: stop matching line for missing feature

Pierre-Yves David pierre-yves.david at ens-lyon.org
Fri Jun 21 02:04:08 UTC 2019


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at octobus.net>
# Date 1560915453 -7200
#      Wed Jun 19 05:37:33 2019 +0200
# Branch stable
# Node ID 3d90d0a9501c59c57e3d9bb4f545c10cf1a440f5
# Parent  d532292eff22b095c994ffedcd4bf98f84f873aa
# EXP-Topic book-del-stable
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 3d90d0a9501c
run-tests: stop matching line for missing feature

Before this change, the following unified test input would silently pass

  $ echo foo
  foo (false !)

After this change, the "foo" output is properly detected as unexpected.

The output of an handful of test had to be updated from broken conditional (that
ended up working by chance).

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -1748,7 +1748,8 @@ class TTest(Test):
 
                 el = m.group(1) + b"\n"
                 if not self._iftest(conditions):
-                    retry = "retry"    # Not required by listed features
+                    # listed feature missing, should not match
+                    return "retry", False
 
         if el.endswith(b" (esc)\n"):
             if PYTHON3:
diff --git a/tests/test-copies.t b/tests/test-copies.t
--- a/tests/test-copies.t
+++ b/tests/test-copies.t
@@ -498,6 +498,7 @@ Try merging the other direction too
   $ hg debugpathcopies 0 4
   x -> z (filelog !)
   y -> z (compatibility !)
+  y -> z (changeset !)
   $ hg debugpathcopies 1 5
   $ hg debugpathcopies 2 5
   $ hg debugpathcopies 0 5
diff --git a/tests/test-extension.t b/tests/test-extension.t
--- a/tests/test-extension.t
+++ b/tests/test-extension.t
@@ -84,8 +84,8 @@ Test basic extension support
   uipopulate called (1 times)
   uipopulate called (1 times) (chg !)
   uipopulate called (1 times) (chg !)
-  uipopulate called (1 times) (chg !)
-  reposetup called for a (chg !)
+  uipopulate called (1 times)
+  reposetup called for a
   ui == repo.ui
   Foo
   $ hg foo --debug
@@ -96,8 +96,8 @@ Test basic extension support
   uipopulate called (1 times)
   uipopulate called (1 times) (chg !)
   uipopulate called (1 times) (chg !)
-  uipopulate called (1 times) (chg !)
-  reposetup called for a (chg !)
+  uipopulate called (1 times)
+  reposetup called for a
   ui == repo.ui
   Foo
 
@@ -107,7 +107,7 @@ Test basic extension support
   uisetup called [status] (no-chg !)
   uipopulate called (1 times)
   uipopulate called (1 times) (chg !)
-  uipopulate called (1 times) (chg !)
+  uipopulate called (1 times)
   reposetup called for a
   ui == repo.ui
   uipopulate called (1 times)
diff --git a/tests/test-narrow-clone-stream.t b/tests/test-narrow-clone-stream.t
--- a/tests/test-narrow-clone-stream.t
+++ b/tests/test-narrow-clone-stream.t
@@ -61,8 +61,10 @@ Cloning a specific file when stream clon
 Making sure we have the correct set of requirements
 
   $ cat .hg/requires
-  dotencode (tree flat-fncache !)
-  fncache (tree flat-fncache !)
+  dotencode (tree !)
+  dotencode (flat-fncache !)
+  fncache (tree !)
+  fncache (flat-fncache !)
   generaldelta
   narrowhg-experimental
   revlogv1
@@ -75,8 +77,9 @@ Making sure store has the required files
   $ ls .hg/store/
   00changelog.i
   00manifest.i
-  data (tree flat-fncache !)
-  fncache (tree flat-fncache !)
+  data
+  fncache (tree !)
+  fncache (flat-fncache !)
   meta (tree !)
   narrowspec
   undo
diff --git a/tests/test-narrow-widen-no-ellipsis.t b/tests/test-narrow-widen-no-ellipsis.t
--- a/tests/test-narrow-widen-no-ellipsis.t
+++ b/tests/test-narrow-widen-no-ellipsis.t
@@ -124,7 +124,7 @@ added upstream revisions.
   adding manifests
   adding widest/ revisions (tree !)
   adding file changes
-  adding widest/f revisions (tree !)
+  adding widest/f revisions
   added 0 changesets with 1 changes to 1 files
   bundle2-input-part: total payload size * (glob)
   bundle2-input-bundle: 0 parts total
diff --git a/tests/test-run-tests.t b/tests/test-run-tests.t
--- a/tests/test-run-tests.t
+++ b/tests/test-run-tests.t
@@ -1936,3 +1936,70 @@ Test automatic pattern replacement
   running 1 tests using 1 parallel processes 
   .
   # Ran 1 tests, 0 skipped, 0 failed.
+
+Test conditional output matching
+================================
+
+  $ cat << EOF >> test-conditional-matching.t
+  > #testcases foo bar
+  >   $ echo richtig
+  >   richtig (true !)
+  >   $ echo falsch
+  >   falsch (false !)
+  > #if foo
+  >   $ echo arthur
+  >   arthur (bar !)
+  > #endif
+  >   $ echo celeste
+  >   celeste (foo !)
+  >   $ echo zephir
+  >   zephir (bar !)
+  > EOF
+
+  $ rt test-conditional-matching.t
+  running 2 tests using 1 parallel processes 
+  
+  --- $TESTTMP/anothertests/cases/test-conditional-matching.t
+  +++ $TESTTMP/anothertests/cases/test-conditional-matching.t#bar.err
+  @@ -3,11 +3,13 @@
+     richtig (true !)
+     $ echo falsch
+     falsch (false !)
+  +  falsch
+   #if foo
+     $ echo arthur
+     arthur \(bar !\) (re)
+   #endif
+     $ echo celeste
+     celeste \(foo !\) (re)
+  +  celeste
+     $ echo zephir
+     zephir \(bar !\) (re)
+  
+  ERROR: test-conditional-matching.t#bar output changed
+  !
+  --- $TESTTMP/anothertests/cases/test-conditional-matching.t
+  +++ $TESTTMP/anothertests/cases/test-conditional-matching.t#foo.err
+  @@ -3,11 +3,14 @@
+     richtig (true !)
+     $ echo falsch
+     falsch (false !)
+  +  falsch
+   #if foo
+     $ echo arthur
+     arthur \(bar !\) (re)
+  +  arthur
+   #endif
+     $ echo celeste
+     celeste \(foo !\) (re)
+     $ echo zephir
+     zephir \(bar !\) (re)
+  +  zephir
+  
+  ERROR: test-conditional-matching.t#foo output changed
+  !
+  Failed test-conditional-matching.t#bar: output changed
+  Failed test-conditional-matching.t#foo: output changed
+  # Ran 2 tests, 0 skipped, 2 failed.
+  python hash seed: * (glob)
+  [1]


More information about the Mercurial-devel mailing list