Mercurial > hg
diff Makefile @ 43289:8d432d3a2d7c
rust-cpython: prepare for writing tests that require libpython
What I wanted is to disable the "cpython/extension-module<ver>" feature
while building tests executable, but that seems not doable. Instead,
this patch adds new features dedicated for tests.
The make rule is extracted so that we can easily run cargo tests.
Added a minimal test of ref-sharing as an example. More tests will follow.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Mon, 14 Oct 2019 16:15:19 +0900 |
parents | 7521e6d18057 |
children | 166808ff91de |
line wrap: on
line diff
--- 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