rust-bindings: Wire up `tests/`
authorColin Walters <walters@verbum.org>
Sun, 12 Jun 2022 18:34:02 +0000 (14:34 -0400)
committerColin Walters <walters@verbum.org>
Sun, 12 Jun 2022 18:34:02 +0000 (14:34 -0400)
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
rust-bindings/tests/util/mod.rs

index a52c27d3ea82372a832a34bc4be5280088c303a3..ba61b1455b8498783df7312013df2827673551ee 100644 (file)
@@ -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"]
 
index 28cca92694df68d8791d4b53f4583f14af81281e..c38daeecd8b6898f1331f3d08b676af190a270a5 100644 (file)
@@ -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");