diff rust/hg-cpython/src/lib.rs @ 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 970978975574
children f98f0e3ddaa1
line wrap: on
line diff
--- a/rust/hg-cpython/src/lib.rs	Sat Oct 05 10:21:34 2019 -0400
+++ b/rust/hg-cpython/src/lib.rs	Mon Oct 14 16:15:19 2019 +0900
@@ -72,3 +72,10 @@
     )?;
     Ok(())
 });
+
+#[cfg(not(any(feature = "python27-bin", feature = "python3-bin")))]
+#[test]
+#[ignore]
+fn libpython_must_be_linked_to_run_tests() {
+    // stub function to tell that some tests wouldn't run
+}