diff options
author | Andrzej Janik <[email protected]> | 2021-12-01 23:08:07 +0100 |
---|---|---|
committer | Andrzej Janik <[email protected]> | 2021-12-01 23:08:07 +0100 |
commit | 400feaf015fc0084608479df58d6cdeccb87986b (patch) | |
tree | 3434eb1974bb6135b8e58e232235a92163477bcd /zluda_inject | |
parent | fd1c13560f29e9f6e43d19b5cbe48dcd1351bcd6 (diff) | |
download | ZLUDA-400feaf015fc0084608479df58d6cdeccb87986b.tar.gz ZLUDA-400feaf015fc0084608479df58d6cdeccb87986b.zip |
Add test for injecting app that directly uses nvcuda
Diffstat (limited to 'zluda_inject')
-rw-r--r-- | zluda_inject/Cargo.toml | 6 | ||||
-rw-r--r-- | zluda_inject/tests/inject.rs | 10 |
2 files changed, 10 insertions, 6 deletions
diff --git a/zluda_inject/Cargo.toml b/zluda_inject/Cargo.toml index 1181a21..cc9dc9b 100644 --- a/zluda_inject/Cargo.toml +++ b/zluda_inject/Cargo.toml @@ -11,3 +11,9 @@ path = "src/main.rs" [target.'cfg(windows)'.dependencies] winapi = { version = "0.3", features = ["jobapi2", "processthreadsapi", "synchapi", "winbase", "std"] } detours-sys = { path = "../detours-sys" } + +[dev-dependencies] +# dependency for integration tests +zluda_redirect = { path = "../zluda_redirect" } +# dependency for integration tests +zluda_dump = { path = "../zluda_dump" } diff --git a/zluda_inject/tests/inject.rs b/zluda_inject/tests/inject.rs index 5a19d8a..de5fef8 100644 --- a/zluda_inject/tests/inject.rs +++ b/zluda_inject/tests/inject.rs @@ -3,8 +3,8 @@ 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 mut zluda_dump_dll = zluda_with_exe.parent().unwrap().to_path_buf();
+ zluda_dump_dll.push("zluda_dump.dll");
let helpers_dir = env!("HELPERS_OUT_DIR");
let exe_under_test = format!(
"{}{}direct_cuinit.exe",
@@ -12,11 +12,9 @@ fn direct_cuinit() -> io::Result<()> { std::path::MAIN_SEPARATOR
);
let mut test_cmd = Command::new(&zluda_with_exe);
- test_cmd
- .arg(&zluda_redirect_dll)
- .arg("--")
- .arg(&exe_under_test);
+ let test_cmd = test_cmd.arg(&zluda_dump_dll).arg("--").arg(&exe_under_test);
let test_output = test_cmd.output()?;
+ assert!(test_output.status.success());
let stderr_text = String::from_utf8(test_output.stderr).unwrap();
assert!(stderr_text.contains("ZLUDA_DUMP"));
Ok(())
|