diff options
author | Andrzej Janik <[email protected]> | 2021-11-30 01:25:51 +0100 |
---|---|---|
committer | Andrzej Janik <[email protected]> | 2021-11-30 01:25:51 +0100 |
commit | fd1c13560f29e9f6e43d19b5cbe48dcd1351bcd6 (patch) | |
tree | 2ee557499f12999eab629ae24d0b239c07707da0 /zluda_inject | |
parent | 3558a0a65cc5e6ae4df8ae4c1d95c6003d50af05 (diff) | |
download | ZLUDA-fd1c13560f29e9f6e43d19b5cbe48dcd1351bcd6.tar.gz ZLUDA-fd1c13560f29e9f6e43d19b5cbe48dcd1351bcd6.zip |
Add failing test for overriding directly linked CUDA dll
Diffstat (limited to 'zluda_inject')
-rw-r--r-- | zluda_inject/tests/inject.rs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/zluda_inject/tests/inject.rs b/zluda_inject/tests/inject.rs index f63186a..5a19d8a 100644 --- a/zluda_inject/tests/inject.rs +++ b/zluda_inject/tests/inject.rs @@ -1,13 +1,23 @@ -use std::{env, io, process::Command};
+use std::{env, io, path::PathBuf, process::Command};
#[test]
fn direct_cuinit() -> io::Result<()> {
+ let zluda_with_exe = PathBuf::from(env!("CARGO_BIN_EXE_zluda_with"));
+ let mut zluda_redirect_dll = zluda_with_exe.parent().unwrap().to_path_buf();
+ zluda_redirect_dll.push("zluda_redirect.dll");
let helpers_dir = env!("HELPERS_OUT_DIR");
- let mut main_exe = Command::new(format!(
+ let exe_under_test = format!(
"{}{}direct_cuinit.exe",
helpers_dir,
std::path::MAIN_SEPARATOR
- ));
- assert!(main_exe.status()?.success());
+ );
+ let mut test_cmd = Command::new(&zluda_with_exe);
+ test_cmd
+ .arg(&zluda_redirect_dll)
+ .arg("--")
+ .arg(&exe_under_test);
+ let test_output = test_cmd.output()?;
+ let stderr_text = String::from_utf8(test_output.stderr).unwrap();
+ assert!(stderr_text.contains("ZLUDA_DUMP"));
Ok(())
}
|