[librsvg] Write test output from the Rust tests to the same output/ dir from the C tests
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] Write test output from the Rust tests to the same output/ dir from the C tests
- Date: Thu, 9 Jan 2020 19:32:10 +0000 (UTC)
commit a5fc7af7a8b4128c26511171063cb99a215750d2
Author: Federico Mena Quintero <federico gnome org>
Date: Thu Jan 9 12:43:33 2020 -0600
Write test output from the Rust tests to the same output/ dir from the C tests
This keeps "make distcheck" happy.
Makefile.am | 8 ++++----
librsvg_crate/tests/utils/mod.rs | 4 +++-
2 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 36cf4abe..d2ab8a3e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -157,13 +157,13 @@ RUST_LIB=$(CARGO_TARGET_DIR)/$(RUST_TARGET_SUBDIR)/librsvg_c_api.a
endif
check-local:
- cd $(srcdir) && \
- CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) \
- OUT_DIR=$(LIBRSVG_BUILD_DIR) \
+ cd $(srcdir) && \
+ CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) \
+ OUT_DIR=$(LIBRSVG_BUILD_DIR)/tests/output \
$(CARGO) --locked test $(CARGO_VERBOSE) $(CARGO_TARGET_ARGS) $(CARGO_RELEASE_ARGS)
clean-local:
- cd $(top_srcdir) && \
+ cd $(top_srcdir) && \
CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) \
$(CARGO) clean
diff --git a/librsvg_crate/tests/utils/mod.rs b/librsvg_crate/tests/utils/mod.rs
index 8b67ce29..d1f5aa52 100644
--- a/librsvg_crate/tests/utils/mod.rs
+++ b/librsvg_crate/tests/utils/mod.rs
@@ -10,7 +10,7 @@ use rsvg_internals;
use self::rsvg_internals::surface_utils::shared_surface::{SharedImageSurface, SurfaceType};
use std::env;
-use std::fs::File;
+use std::fs::{self, File};
use std::io::BufReader;
use std::path::PathBuf;
@@ -58,6 +58,8 @@ pub fn output_dir() -> PathBuf {
.expect(r#"OUT_DIR is not set, please set it or run under "cargo test""#),
);
+ fs::create_dir_all(&path).expect("could not create output directory for tests");
+
println!("outputting to {}", path.to_string_lossy());
path
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]