From 5d57025e1686b95301341b8dad3b4b340020a7c4 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 26 Sep 2018 14:43:18 +0000 Subject: [PATCH] build-sys: Add a `rust-test` target I often am editing just the Rust code, and want the fast iteration feedback of a `cargo test` - don't want to pay the cost of full optimization (particularly LTO) for the release build, and I *just* want to run the Rust tests. Basically if you're editing our Rust code a lot, this target is your friend. Closes: #1585 Approved by: jlebon --- Makefile-rpm-ostree.am | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Makefile-rpm-ostree.am b/Makefile-rpm-ostree.am index 8a18c8ad..12df426c 100644 --- a/Makefile-rpm-ostree.am +++ b/Makefile-rpm-ostree.am @@ -129,3 +129,10 @@ rustfmt: rustfmt $(LIBRPMOSTREE_RUST_SRCS) # Outside the ifdef, otherwise automake complains .PHONY: rustfmt + +# Wraps `cargo test`. This is always a debug non-release build; +# the main thing here is we still drop the `target` dir in our build +# directory, since we nominally support srcdir != builddir. +rust-test: + cd $(top_srcdir)/rust && CARGO_TARGET_DIR=@abs_top_builddir@/target cargo test +.PHONY: rust-test