2021-11-30 01:25:51 +01:00
|
|
|
use std::{env, io, path::PathBuf, process::Command};
|
2021-11-28 23:51:41 +01:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn direct_cuinit() -> io::Result<()> {
|
2021-11-30 01:25:51 +01:00
|
|
|
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");
|
2021-11-28 23:51:41 +01:00
|
|
|
let helpers_dir = env!("HELPERS_OUT_DIR");
|
2021-11-30 01:25:51 +01:00
|
|
|
let exe_under_test = format!(
|
2021-11-28 23:51:41 +01:00
|
|
|
"{}{}direct_cuinit.exe",
|
|
|
|
helpers_dir,
|
|
|
|
std::path::MAIN_SEPARATOR
|
2021-11-30 01:25:51 +01:00
|
|
|
);
|
|
|
|
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"));
|
2021-11-28 23:51:41 +01:00
|
|
|
Ok(())
|
|
|
|
}
|