mirror of
https://github.com/redstrate/Physis.git
synced 2025-05-03 17:27:46 +00:00
Give patch_testing the same treatment as retail_testing
This commit is contained in:
parent
4725da2f3e
commit
a6afff0d7a
2 changed files with 7 additions and 9 deletions
10
Cargo.toml
10
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]
|
||||
|
|
|
@ -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<Path>) -> Vec<PathBuf> {
|
|||
.collect()
|
||||
}
|
||||
|
||||
#[cfg(feature = "patch_testing")]
|
||||
fn fill_dir_hash(game_dir: &str) -> HashMap<String, [u8; 64]> {
|
||||
let mut file_hashes: HashMap<String, [u8; 64]> = HashMap::new();
|
||||
|
||||
|
@ -71,7 +69,6 @@ fn fill_dir_hash(game_dir: &str) -> HashMap<String, [u8; 64]> {
|
|||
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...");
|
||||
|
Loading…
Add table
Reference in a new issue