diff --git a/Cargo.toml b/Cargo.toml index 46752d1..cdb8f2a 100755 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,11 +21,15 @@ harness = false [[bench]] name = "retail_benchmark" harness = false -required-features = ["retail_game_testing"] +required-features = ["retail_testing"] [[test]] name = "retail_test" -required-features = ["retail_game_testing"] +required-features = ["retail_testing"] + +[[test]] +name = "patch_test" +required-features = ["patch_testing"] [dev-dependencies] # used while rust doesn't have native benchmarking capability @@ -38,7 +42,7 @@ crc = "3" default = [] # testing only features -retail_game_testing = [] +retail_testing = [] patch_testing = [] [dependencies] diff --git a/tests/patching_test.rs b/tests/patch_test.rs similarity index 97% rename from tests/patching_test.rs rename to tests/patch_test.rs index 4cabd39..973f5e0 100644 --- a/tests/patching_test.rs +++ b/tests/patch_test.rs @@ -5,7 +5,6 @@ use std::fs::read_dir; use std::path::{Path, PathBuf}; -#[cfg(feature = "patch_testing")] fn make_temp_install_dir(name: &str) -> String { use physis::installer::install_game; @@ -50,7 +49,6 @@ fn recurse(path: impl AsRef) -> Vec { .collect() } -#[cfg(feature = "patch_testing")] fn fill_dir_hash(game_dir: &str) -> HashMap { let mut file_hashes: HashMap = HashMap::new(); @@ -71,7 +69,6 @@ fn fill_dir_hash(game_dir: &str) -> HashMap { file_hashes } -#[cfg(feature = "patch_testing")] fn physis_install_patch(game_directory: &str, data_directory: &str, patch_name: &str) { let patch_dir = env::var("FFXIV_PATCH_DIR").unwrap(); @@ -81,7 +78,6 @@ fn physis_install_patch(game_directory: &str, data_directory: &str, patch_name: ZiPatch::apply(&data_dir, &patch_path).unwrap(); } -#[cfg(feature = "patch_testing")] fn xivlauncher_install_patch(game_directory: &str, data_directory: &str, patch_name: &str) { let patch_dir = env::var("FFXIV_PATCH_DIR").unwrap(); let patcher_exe = env::var("FFXIV_XIV_LAUNCHER_PATCHER") @@ -106,7 +102,6 @@ fn xivlauncher_install_patch(game_directory: &str, data_directory: &str, patch_n assert!(output.status.success()); } -#[cfg(feature = "patch_testing")] fn check_if_files_match(xivlauncher_dir: &str, physis_dir: &str) { let xivlauncher_files = fill_dir_hash(xivlauncher_dir); let physis_files = fill_dir_hash(physis_dir); @@ -121,7 +116,6 @@ fn check_if_files_match(xivlauncher_dir: &str, physis_dir: &str) { } #[test] -#[cfg(feature = "patch_testing")] fn test_patching() { println!("Beginning game installation...");