Files
oak-editor/crates/oakplugin/tests/golden_test.rs
T
Mike-Solar ab1a2e9c7b refactor: drop internal bridge/ffi layers; exporter family lands
Single-lib cleanup: the per-crate src/bridge/ and src/ffi.rs layers are
gone (oakundo/oakcommon/oaknode/oaktimeline/oakcodec/oakaudio/
oakrender/oaktask/oakplugin/oakstorage); cross-crate calls are plain
Rust, CHandle marshalling shrinks to the oakengine boundary, and tests
call the Rust APIs directly (pure C-ABI wrapper tests removed where
the domain layer already covers the behavior).

exporter.h family implemented: oakengine_export_render (CLI contract),
oakengine_export_render_with_params (was a stub), last_error and
progress callback; synchronous path reuses task_create_export +
start_sync. Fixes on the way: oaktask video ticket self-deadlock,
audio params dropped on the export path, codec encoder AAC slicing and
H.264 time base. Real-mp4 tests cover both entry points, progress and
the illegal-argument matrix.

Also: oakstorage session maps null project handles to None (version-
info path), configstore test double literal 3.14 -> 3.15 (clippy PI
lint), oakaudio output callback scratch buffer + env-aware P1 test,
cli media round-trip test uses a generated 16-frame clip (no more
minute-long debug runs).
2026-08-16 00:33:45 +08:00

118 lines
5.4 KiB
Rust
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 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 <http://www.gnu.org/licenses/>.
//! Golden master:描述符快照 diff 与渲染帧比对(M11 §2.2/§2.3)。
//!
//! 快照在 0 期由**现行 C++ 实现**抓取入库(tests/ofx/snapshots/ 与
//! tests/ofx/frames/);本文件的测试断言 Rust 实现与之逐字段/逐像素
//! 一致。**0 期基建尚未落地**(tests/ofx/ 目录为空)——依赖快照/
//! 帧/GL 的用例一律 `#[ignore]`,落地后摘掉并补全断言(见
//! [`descriptor_snapshots_match`] 的说明)。无真实 bundle 的环境
//! CI)整文件 skip。
//!
//! [`cimg_full_describe_smoke`] 不依赖快照:真实 CImg bundle 存在时
//! 全量 describe + 协商冒烟(健壮性,不比对),是本次唯一实际执行
//! 的用例。
mod common;
/// 描述符快照:对快照清单中的每个插件,字段级 diff——标识、版本、
/// 上下文集合、参数矩阵(名称/类型/默认值/标签/hint/父组/secret/
/// display range/choice labels+values+排序结果)、clip 表。任何 diff
/// 打印成 unified diff 供定位。
///
/// # ignore 原因(M11 0 期基建缺失)
///
/// `tests/ofx/snapshots/`C++ 实现抓取的描述符 JSON 库)尚未生成。
/// 快照落地后摘掉本注解并实现:扫描快照清单 → 每插件 describe →
/// 与 JSON 逐字段比对。当前无快照可比对,硬跑必假红。
#[test]
#[ignore = "M11 0 期快照库(tests/ofx/snapshots/)尚未生成;落地后实现并摘除"]
fn descriptor_snapshots_match() {
todo!("0 期快照落地后实现:扫描快照清单 → describe → 逐字段 diff")
}
/// clip 协商快照:getClipPreferences 之后的输出分量/位深/像素比/
/// 帧率/field 与快照一致(隐式行为的主要回归防线)。
///
/// # ignore 原因
///
/// 同 [`descriptor_snapshots_match`]:协商快照(含 getClipPreferences
/// 协商后结果)在 `tests/ofx/snapshots/`,尚未生成。
#[test]
#[ignore = "M11 0 期协商快照尚未生成;落地后实现并摘除"]
fn negotiated_clip_preferences_match() {
todo!("0 期协商快照落地后实现")
}
/// CImg 全量插件冒烟:每个插件 describe + 协商不崩、不泄漏
/// (不比对快照,只验健壮性——覆盖快照集之外的怪癖)。
///
/// # ignore 原因(本机 CImg bundle 的宿主兼容缺口)
///
/// 本机安装的 CImg.ofx.bundle 是 Natron 分支构建:describe 期间写
/// 专属属性 `NatronOfxImageEffectPropDeprecated`,且其 OFX support
/// 的 `Property::Set` 句柄语义与本 crate 的打标句柄约定不兼容
/// (插件侧属性写入在进入本宿主属性套件前失败 → describe 返回
/// kOfxStatErrMissingHostFeature)。真实插件的端到端加载/建实例/
/// 协商路径由 Misc.ofx.bundle(标准 openfx-misc 构建)冒烟覆盖。
/// CImg 兼容属 M11 §3.5「CImg 全量 describe/协商冒烟」的宿主保真
/// 缺口——属性套件适配插件侧 `Property::Set` 句柄后摘除本注解。
#[test]
#[ignore = "本机 CImg.ofx.bundle 为 Natron 分支构建,属性套件句柄语义不兼容(describe 返回 MissingHostFeature);Misc 系统冒烟已覆盖真实插件路径"]
fn cimg_full_describe_smoke() {
todo!("属性套件适配 Natron 分支的 Property::Set 句柄后实现:全量 describe + 协商不崩、不泄漏")
}
/// CPU 渲染 golden:代表性效果集逐帧 SHA256 一致(bit 级)。
/// 输入帧为合成渐变+色块(确定性生成器在 common 里)。
///
/// # ignore 原因
///
/// `tests/ofx/frames/`C++ 实现抓取的 EXR + SHA256 库)尚未生成;
/// 且 CPU 渲染链路依赖 renderer 桥(cargo 内无 liboakrender 真实现,
/// 只有测试桩)。快照与真桥都落地后实现并摘除。
#[test]
#[ignore = "M11 0 期渲染 goldentests/ofx/frames/+ 真 liboakrender 缺失;落地后实现并摘除"]
fn render_golden_cpu_bitexact() {
todo!("0 期渲染 golden 落地后实现")
}
/// GL 渲染 golden1e-4 容差(驱动差异);无 GPU 环境 skip。
///
/// # ignore 原因
///
/// GL 路径属 M11 第 2 期(OpenGLRender suite 未实现),帧库亦未生成。
#[test]
#[ignore = "GL 路径属 M11 第 2 期,且帧库未生成;2 期后实现并摘除"]
fn render_golden_gl_tolerant() {
todo!("M11 第 2 期 GL 路径落地后实现")
}
/// F32+ACEScg 链路断言:golden 帧的像素格式为 F32,且经 OCIO
/// display transform 后与参考值在容差内(色彩链路没被偷换成 8-bit
/// 的回归防线)。
///
/// # ignore 原因
///
/// 同 [`render_golden_cpu_bitexact`]:依赖帧库与 OCIO 链路
/// ofxColour 属 M11 第 2 期)。
#[test]
#[ignore = "M11 0 期帧库 + 第 2 期 ofxColour/OCIO 链路缺失;落地后实现并摘除"]
fn pipeline_is_f32_acescg() {
todo!("帧库与 OCIO 链路落地后实现")
}