Makefile
changeset 43289 8d432d3a2d7c
parent 42805 7521e6d18057
child 43354 166808ff91de
--- a/Makefile	Sat Oct 05 10:21:34 2019 -0400
+++ b/Makefile	Mon Oct 14 16:15:19 2019 +0900
@@ -113,7 +113,7 @@
 tests:
         # Run Rust tests if cargo is installed
 	if command -v $(CARGO) >/dev/null 2>&1; then \
-		cd $(HGROOT)/rust/hg-cpython && $(CARGO) test --quiet --all; \
+		$(MAKE) rust-tests; \
 	fi
 	cd tests && $(PYTHON) run-tests.py $(TESTFLAGS)
 
@@ -127,6 +127,13 @@
         $(MAKE) -f $(HGROOT)/contrib/Makefile.python PYTHONVER=$* PREFIX=$(HGPYTHONS)/$* python )
 	cd tests && $(HGPYTHONS)/$*/bin/python run-tests.py $(TESTFLAGS)
 
+rust-tests: py_feature = $(shell $(PYTHON) -c \
+ 'import sys; print(["python27-bin", "python3-bin"][sys.version_info[0] >= 3])')
+rust-tests:
+	cd $(HGROOT)/rust/hg-cpython \
+		&& $(CARGO) test --quiet --all \
+			--no-default-features --features "$(py_feature)"
+
 check-code:
 	hg manifest | xargs python contrib/check-code.py
 
@@ -248,6 +255,7 @@
 
 .PHONY: help all local build doc cleanbutpackages clean install install-bin \
 	install-doc install-home install-home-bin install-home-doc \
-	dist dist-notests check tests check-code format-c update-pot \
+	dist dist-notests check tests rust-tests check-code format-c \
+	update-pot \
 	$(packaging_targets) \
 	osx