add wrapping modules in integration tests

This commit is contained in:
Cyryl Płotnicki 2020-11-28 14:29:23 +00:00
parent 5728645add
commit 4266f48b03
3 changed files with 218 additions and 211 deletions

View file

@ -1,3 +1,5 @@
#[cfg(test)]
mod must {
use std::fs; use std::fs;
use std::path::Path; use std::path::Path;
@ -8,7 +10,6 @@ use bakare::{backup, restore};
use nix::sys::wait::{waitpid, WaitStatus}; use nix::sys::wait::{waitpid, WaitStatus};
use nix::unistd::{fork, ForkResult}; use nix::unistd::{fork, ForkResult};
use tempfile::tempdir; use tempfile::tempdir;
#[test] #[test]
fn handle_concurrent_backups() -> Result<()> { fn handle_concurrent_backups() -> Result<()> {
setup_logger(); setup_logger();
@ -102,3 +103,4 @@ fn setup_logger() {
fn file_id(i: usize, j: usize) -> String { fn file_id(i: usize, j: usize) -> String {
format!("{}-{}", i, j) format!("{}-{}", i, j)
} }
}

View file

@ -1,10 +1,11 @@
#[cfg(test)]
mod must {
use tempfile::tempdir; use tempfile::tempdir;
use bakare::repository::Repository; use bakare::repository::Repository;
use bakare::test::{assertions::*, source::TestSource}; use bakare::test::{assertions::*, source::TestSource};
use proptest::prelude::*; use proptest::prelude::*;
proptest! { proptest! {
#[test] #[test]
fn store_duplicated_files_just_once(contents in any::<[u8;3]>()) { fn store_duplicated_files_just_once(contents in any::<[u8;3]>()) {
@ -25,3 +26,4 @@ proptest! {
assert_restored_file_contents(repository_path, &source.file_path("2"), &contents).unwrap(); assert_restored_file_contents(repository_path, &source.file_path("2"), &contents).unwrap();
} }
} }
}

View file

@ -1,3 +1,5 @@
#[cfg(test)]
mod must {
use tempfile::tempdir; use tempfile::tempdir;
use anyhow::Result; use anyhow::Result;
@ -106,3 +108,4 @@ fn forbid_backup_of_paths_within_repository() -> Result<()> {
// TODO: index corruption // TODO: index corruption
// TODO: encryption // TODO: encryption
// TODO: resume from sleep while backup in progress // TODO: resume from sleep while backup in progress
}