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
This commit is contained in:
Colin Walters 2018-09-26 14:43:18 +00:00 committed by Atomic Bot
parent 1cf8283904
commit 5d57025e16

View File

@ -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