Patchwork D9728: rhg: use a release-mode executable in tests

login
register
mail settings
Submitter phabricator
Date Jan. 12, 2021, 5:41 p.m.
Message ID <differential-rev-PHID-DREV-fi57ghphfezazyxbszxi-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48039/
State Superseded
Headers show

Comments

phabricator - Jan. 12, 2021, 5:41 p.m.
SimonSapin created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This allows the rhg build for test-rhg.t to share compiled dependencies
  such as hg-core with the hg-cpython build for other tests.
  
  For context, my wrapper script for the typical edit-compile-test
  cycle now looks like this:
  
    (cd rust && cargo +nightly-2020-10-04 fmt)
    (cd rust && cargo build --release -p rhg)
    make --silent local PURE=--rust
    python test/run-tests.py --local "$@"

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/test-rhg.t

CHANGE DETAILS




To: SimonSapin, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-rhg.t b/tests/test-rhg.t
--- a/tests/test-rhg.t
+++ b/tests/test-rhg.t
@@ -2,8 +2,8 @@ 
 
 Define an rhg function that will only run if rhg exists
   $ rhg() {
-  > if [ -f "$RUNTESTDIR/../rust/target/debug/rhg" ]; then
-  >   "$RUNTESTDIR/../rust/target/debug/rhg" "$@"
+  > if [ -f "$RUNTESTDIR/../rust/target/release/rhg" ]; then
+  >   "$RUNTESTDIR/../rust/target/release/rhg" "$@"
   > else
   >   echo "skipped: Cannot find rhg. Try to run cargo build in rust/rhg."
   >   exit 80