Patchwork D1858: tests: make hg frame optional

login
register
mail settings
Submitter phabricator
Date Jan. 14, 2018, 11:04 p.m.
Message ID <differential-rev-PHID-DREV-z65hepdfabjc3qouzuy6-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/26748/
State Superseded
Headers show

Comments

phabricator - Jan. 14, 2018, 11:04 p.m.
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  When `hg` is a Rust binary, the `hg` frame doesn't exist because an
  `hg` Python script doesn't exist.
  
  This commit updates expected test output to make the `hg` frame
  optional.
  
  There /might/ be a way to do this more accurately with the
  "(feature !)" syntax in .t files. However, I poked at it for a
  few minutes and couldn't get it to work. Worst case with using
  (?) is we drop the frame from output for Python `hg`. The `hg`
  frame isn't terribly important. So the worst case doesn't feel that
  bad. If someone wants to enlighten me on how to use "(feature !)"
  for optional output based on hghave features, I'd be more than
  willing to update this.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1858

AFFECTED FILES
  tests/test-devel-warnings.t

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel
phabricator - Jan. 14, 2018, 11:30 p.m.
mharbison72 added a comment.


  I haven't been paying attention to the rust threads, but is there an hghave test for it?  I don't see one locally.  If so, then all that should be needed is appending ' (no-rust !)'.  (Note the spaces.)  I think this works for #test-cases too.
  
  Note that this is *not* an "if and only if" test.  If you evaluate the feature(s) listed, it will be required for '(true !)', and reverts to (?) for '(false !)'.  I had a patch to make it IFF, because that's how it seems to be used in practice.  But somehow I came up with a test that succeeded outside test-run-tests.t, but failed inside it.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1858

To: indygreg, #hg-reviewers
Cc: mharbison72, mercurial-devel
phabricator - Jan. 15, 2018, 1:05 p.m.
yuja added a comment.


  I think the frame details aren't important here, so making some lines optional
  should be just fine.
  
  Queued, thanks.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1858

To: indygreg, #hg-reviewers
Cc: yuja, mharbison72, mercurial-devel

Patch

diff --git a/tests/test-devel-warnings.t b/tests/test-devel-warnings.t
--- a/tests/test-devel-warnings.t
+++ b/tests/test-devel-warnings.t
@@ -99,7 +99,7 @@ 
 #if no-chg
   $ hg buggylocking --traceback
   devel-warn: "wlock" acquired after "lock" at:
-   */hg:* in <module> (glob)
+   */hg:* in <module> (glob) (?)
    */mercurial/dispatch.py:* in run (glob)
    */mercurial/dispatch.py:* in dispatch (glob)
    */mercurial/dispatch.py:* in _runcatch (glob)
@@ -115,7 +115,7 @@ 
 #else
   $ hg buggylocking --traceback
   devel-warn: "wlock" acquired after "lock" at:
-   */hg:* in <module> (glob)
+   */hg:* in <module> (glob) (?)
    */mercurial/dispatch.py:* in run (glob)
    */mercurial/dispatch.py:* in dispatch (glob)
    */mercurial/dispatch.py:* in _runcatch (glob)
@@ -177,7 +177,7 @@ 
   $ hg oldanddeprecated --traceback
   devel-warn: foorbar is deprecated, go shopping
   (compatibility will be dropped after Mercurial-42.1337, update your code.) at:
-   */hg:* in <module> (glob)
+   */hg:* in <module> (glob) (?)
    */mercurial/dispatch.py:* in run (glob)
    */mercurial/dispatch.py:* in dispatch (glob)
    */mercurial/dispatch.py:* in _runcatch (glob)
@@ -238,7 +238,7 @@ 
   1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated --traceback
   1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> devel-warn: foorbar is deprecated, go shopping
   (compatibility will be dropped after Mercurial-42.1337, update your code.) at:
-   */hg:* in <module> (glob)
+   */hg:* in <module> (glob) (?)
    */mercurial/dispatch.py:* in run (glob)
    */mercurial/dispatch.py:* in dispatch (glob)
    */mercurial/dispatch.py:* in _runcatch (glob)