From dcd36e301920b09ba3becd2cc16907f3f576b01e Mon Sep 17 00:00:00 2001 From: Nick Clifford Date: Sat, 13 Jan 2024 18:53:52 -0600 Subject: [PATCH] cleaner test harness, bump version for publish --- Cargo.toml | 18 +++++++++--------- tests/common/mod.rs | 11 ++++++----- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 57de3eb..dac0668 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dotnetdll" -version = "0.0.1" +version = "0.0.2" authors = ["Nick Clifford "] edition = "2021" license = "GPL-3.0+" @@ -17,19 +17,19 @@ members = [ ] [dependencies] -bitfield = "0.14.0" +bitfield = "0.14" bitvec = "1" dotnetdll-macros = { path = "dotnetdll-macros", version = "0.0.1" } num-traits = "0.2" num-derive = "0.4" -object = { version = "0.32.1", features = ['write'] } -paste = "1.0.5" -scroll = { version = "0.11.0", features = ['derive'] } -scroll-buffer = "0.3.1" -thiserror = "1.0.31" -tracing = "0.1.40" +object = { version = "0.32", features = ['write'] } +paste = "1" +scroll = { version = "0.11", features = ['derive'] } +scroll-buffer = "0.3" +thiserror = "1" +tracing = "0.1" [dev-dependencies] -once_cell = "1.16.0" +once_cell = "1" regex = "1" tempfile = "3" diff --git a/tests/common/mod.rs b/tests/common/mod.rs index 144b3e6..47c8d74 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -1,5 +1,6 @@ #![allow(dead_code)] +use std::path::PathBuf; use dotnetdll::prelude::*; use std::process::Command; use tempfile::TempDir; @@ -151,17 +152,17 @@ pub fn write_fixture( let stderr = String::from_utf8(output.stderr)?; if stderr.contains("Unhandled exception") { - if env::optional("ILDASM").is_some() { - Command::new(env::ILDASM.clone()).arg(&dll_path).spawn()?.wait()?; + if let Some(path) = env::optional("ILDASM") { + Command::new(path).arg(&dll_path).spawn()?.wait()?; } - if let Ok(r) = std::env::var("RUNTIME") { + if let Some(r) = env::optional("RUNTIME") { Command::new("gdb") .arg("-ex") .arg(format!("set substitute-path /runtime {}", r)) .arg("--args") - .arg(if env::optional("ILDASM").is_some() { - env::ILDASM.clone() + .arg(if let Some(path) = env::optional("ILDASM"){ + PathBuf::from(path) } else { env::LIBRARIES.join("corerun") })