tests: assemble the OFX fixture bundle correctly on Windows
The fixture plugin binary was copied into Contents/Linux-x86-64 under the extension-less name "plugin" on every non-macOS platform. On Windows the host never loads it: LoadLibrary appends .dll to extension-less module names, so the scan found the bundle but produced no plugin — and because the (passing) draw-overlay test scans first, the path dedupe then hid the failure from the lifecycle test, which died with "interact variant instance: NotFound". Use Contents/Win64 and plugin.dll on Windows in both bundle assembly sites.
This commit is contained in:
@@ -52,12 +52,20 @@ pub fn test_plugin_dir() -> Option<PathBuf> {
|
||||
.join("oak-test-plugin.ofx.bundle");
|
||||
let platform = if cfg!(target_os = "macos") {
|
||||
"MacOS"
|
||||
} else if cfg!(target_os = "windows") {
|
||||
"Win64"
|
||||
} else {
|
||||
"Linux-x86-64"
|
||||
};
|
||||
let bin_dir = bundle.join("Contents").join(platform);
|
||||
std::fs::create_dir_all(&bin_dir).ok()?;
|
||||
let target = bin_dir.join("plugin");
|
||||
// Windows 上必须有 .dll 扩展名:LoadLibrary 会对无扩展名的
|
||||
// 模块名自动追加 ".dll",名为 "plugin" 的文件将加载失败。
|
||||
let target = bin_dir.join(if cfg!(target_os = "windows") {
|
||||
"plugin.dll"
|
||||
} else {
|
||||
"plugin"
|
||||
});
|
||||
if !target.exists() {
|
||||
std::fs::copy(&lib, &target).ok()?;
|
||||
}
|
||||
|
||||
+9
-1
@@ -798,12 +798,20 @@ mod tests {
|
||||
.join("oak-test-plugin.ofx.bundle");
|
||||
let platform = if cfg!(target_os = "macos") {
|
||||
"MacOS"
|
||||
} else if cfg!(target_os = "windows") {
|
||||
"Win64"
|
||||
} else {
|
||||
"Linux-x86-64"
|
||||
};
|
||||
let bin_dir = bundle.join("Contents").join(platform);
|
||||
std::fs::create_dir_all(&bin_dir).ok()?;
|
||||
let target = bin_dir.join("plugin");
|
||||
// Windows needs the .dll extension: LoadLibrary appends ".dll" to
|
||||
// extension-less module names, so a bare "plugin" file never loads.
|
||||
let target = bin_dir.join(if cfg!(target_os = "windows") {
|
||||
"plugin.dll"
|
||||
} else {
|
||||
"plugin"
|
||||
});
|
||||
if !target.exists() {
|
||||
std::fs::copy(&lib, &target).ok()?;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user