[PATCH STABLE] makefile: run Rust tests if cargo is installed

Raphaël Gomès raphael.gomes at octobus.net
Thu Aug 22 02:08:07 EDT 2019


# HG changeset patch
# User Raphaël Gomès <rgomes at octobus.net>
# Date 1566403010 -7200
#      Wed Aug 21 17:56:50 2019 +0200
# Branch stable
# Node ID 8b57d53e4b0c4d84962c945ee179e3aa6c231c9f
# Parent  302dbc9d52beeb2ef677aa18b3fa005bbce2134e
makefile: run Rust tests if cargo is installed

While no particular minimum toolchain version is targeted as of yet, this
serves as a first step to make more people/machines run the Rust tests.

diff -r 302dbc9d52be -r 8b57d53e4b0c Makefile
--- a/Makefile	Fri Aug 16 15:41:53 2019 +0300
+++ b/Makefile	Wed Aug 21 17:56:50 2019 +0200
@@ -16,6 +16,7 @@
 export LC_ALL=C
 TESTFLAGS ?= $(shell echo $$HGTESTFLAGS)
 OSXVERSIONFLAGS ?= $(shell echo $$OSXVERSIONFLAGS)
+CARGO=cargo
 
 # Set this to e.g. "mingw32" to use a non-default compiler.
 COMPILER=
@@ -110,7 +111,11 @@
 check: tests
 
 tests:
-	cd tests && $(PYTHON) run-tests.py $(TESTFLAGS)
+  # Run Rust tests if cargo is installed
+	if [ -x "$$(command -v $(CARGO))" ]; then \
+		cd $(HGROOT)/rust/hg-cpython && $(CARGO) test --quiet --all; \
+	fi;
+	cd tests && $(PYTHON) run-tests.py $(TESTFLAGS);
 
 test-%:
 	cd tests && $(PYTHON) run-tests.py $(TESTFLAGS) $@


More information about the Mercurial-devel mailing list