comparison tests/test-rhg.t @ 46228:e73b40c790ec

rhg: use a release-mode executable in tests 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 "$@" Differential Revision: https://phab.mercurial-scm.org/D9728
author Simon Sapin <simon.sapin@octobus.net>
date Tue, 12 Jan 2021 18:36:22 +0100
parents 9eb07ab3f2d4
children 02d3bb972121
comparison
equal deleted inserted replaced
46227:5bae4bc9bd42 46228:e73b40c790ec
1 #require rust 1 #require rust
2 2
3 Define an rhg function that will only run if rhg exists 3 Define an rhg function that will only run if rhg exists
4 $ rhg() { 4 $ rhg() {
5 > if [ -f "$RUNTESTDIR/../rust/target/debug/rhg" ]; then 5 > if [ -f "$RUNTESTDIR/../rust/target/release/rhg" ]; then
6 > "$RUNTESTDIR/../rust/target/debug/rhg" "$@" 6 > "$RUNTESTDIR/../rust/target/release/rhg" "$@"
7 > else 7 > else
8 > echo "skipped: Cannot find rhg. Try to run cargo build in rust/rhg." 8 > echo "skipped: Cannot find rhg. Try to run cargo build in rust/rhg."
9 > exit 80 9 > exit 80
10 > fi 10 > fi
11 > } 11 > }