// Oak Video Editor - Non-Linear Video Editor
// Copyright (C) 2026 Oak Team
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
//! 测试公共件:最小测试插件定位、快照/golden 文件路径、夹具。
//!
//! 最小测试插件(cbits/oak_test_plugin.c,build.rs 编译为共享库,
//! 运行时装配成 oak-test-plugin.ofx.bundle):filter 上下文、
//! Double 参数 gain、双 clip(Source/Output)。插件未构建时相关
//! 用例经 [`skip`] 提前返回。
//! 单库化后像素路径经 oakrender 值模型(`oakrender::texture::Texture`)
//! 驱动;渲染 goldens 待该迁移落地。
use std::path::PathBuf;
/// 构建系统注入插件路径的环境变量名。
pub const TEST_PLUGIN_ENV: &str = "OAK_TEST_PLUGIN_DIR";
/// 测试插件 bundle 的绝对路径(由构建系统经环境变量注入;
/// 未注入时用 build.rs 编的共享库现场装配 bundle 目录;均不可用
/// 时返回 None,调用方 skip)。
pub fn test_plugin_dir() -> Option {
if let Some(p) = std::env::var_os(TEST_PLUGIN_ENV) {
return Some(PathBuf::from(p));
}
static BUNDLE: std::sync::OnceLock