From eee0eea58b0de7b46c6c5086b041a967efdd330f Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Sun, 12 Jun 2022 14:34:02 -0400 Subject: [PATCH] rust-bindings: Wire up `tests/` Because the source is in a subdirectory, we lose out on cargo target autodiscovery. I noticed this when I edited one of the tests in a way that should have failed, but didn't... --- Cargo.toml | 4 ++++ rust-bindings/tests/util/mod.rs | 5 +---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a52c27d3..ba61b145 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,6 +29,10 @@ features = ["dox"] name = "ostree" path = "rust-bindings/src/lib.rs" +[[test]] +name = "integration" +path = "rust-bindings/tests/tests.rs" + [workspace] members = [".", "rust-bindings/sys"] diff --git a/rust-bindings/tests/util/mod.rs b/rust-bindings/tests/util/mod.rs index 28cca926..c38daeec 100644 --- a/rust-bindings/tests/util/mod.rs +++ b/rust-bindings/tests/util/mod.rs @@ -53,10 +53,7 @@ pub fn create_mtree(repo: &ostree::Repo) -> ostree::MutableTree { assert_eq!(mtree.copy_files().len(), 0); assert_eq!(mtree.copy_subdirs().len(), 0); let file = gio::File::for_path( - Path::new(env!("CARGO_MANIFEST_DIR")) - .join("tests") - .join("data") - .join("test.tar"), + Path::new(env!("CARGO_MANIFEST_DIR")).join("rust-bindings/tests/data/test.tar"), ); repo.write_archive_to_mtree(&file, &mtree, None, true, NONE_CANCELLABLE) .expect("test mtree");