Skip to content

Latest commit

 

History

History
147 lines (128 loc) · 37.9 KB

TestCoverage.md

File metadata and controls

147 lines (128 loc) · 37.9 KB

测试对应表

本表按产品代码中的类声明和定义记录测试入口。头文件内的多个类共享所属头文件的测试文件,私有实现和抽象基类通过所属接口或具体实现的测试验证。表中的对应关系用于追踪测试归属,不表示所有方法、分支或平台实现均已覆盖。

目录及命名遵守 SynthRT 的 Development.md。具体行为作为用例名,独立拆分的行为保留 test_<头文件名>_<行为>.cpp 名称。新增或移动类时应同时更新测试注册和本表。

ONNX 验证使用 CPU。CUDA、DirectML 的硬件执行路径仍需要对应设备环境。tests/manual 的安装器和推理运行器提供真实 Package 与模型的集成验证,不计入 CTest。真实训练模型仍需相应集成夹具。

身份类型重构前的完整工作区验证:先确认构建退出码为 0,再运行 CTest。synthrt 注册 71 项测试,Boost.Test 实际执行 14290 条断言。全部通过,无跳过。

2026-11-17 身份类型重构验证:构建退出码为 0,71 项 CTest 全部通过。test_ContribContract 的 4 个用例、30 条断言通过。本轮未重新统计全库 Boost.Test 断言总数。

2026-11-18 Task 执行拆分验证:构建退出码为 0,synthrt 的 73 项 CTest 全部通过,Boost.Test 实际执行 14441 条断言。wolf 的 41 项测试和 otter 的 30 项测试全部通过,otter 的两个 RealEngine 测试因本机未配置引擎而跳过。

2026-11-18 Task 线程验证:以 GCC ThreadSanitizer 构建 synthrt 与 stdcorelib,test_ITask 的 12 个用例、70 条断言连续执行 100 次,无 TSan 报告。测试中的并发回调计数改为原子变量,Boost 断言移到主线程执行。

2026-11-18 per-import options 验证:Duration、Acoustic、Pitch 与 Variance Task 的 CTest 全部通过。新增用例验证 speaker mapping 进入模型输入,以及同一 Variance target 的两套 predictions 生成不同返回结果,同时模型声明的全部预测参数都进入输入。

2026-11-18 manual 目标验证:删除产品的 dsinfer-cli 目标,dsinfer-installer 与 dsinfer-runner 以 TEST CONSOLE 目标构建在 out/bin,不进入安装。构建退出码为 0,synthrt 的 69 项 CTest 全部通过。真实的 YOUSA 1.65 Package 经安装器装载后完成 ONNX 五阶段推理并生成 210988 字节 WAV。

产品文件 类及内部类型 测试入口 验证方式
synthrt/include/synthrt/Core/ContribCategory.h ContribCreateContext, ContribCategory test_ContribCategory、test_SynthUnit 通过所属接口或集成流程验证
synthrt/include/synthrt/Core/ContribExecutive.h ContribRuntimeOptions, ContribExecutive, ContribExecutiveFactory test_ContribExecutive、test_SynthUnit、test_DiffSingerPipelineExecutive 通过所属接口或集成流程验证
synthrt/include/synthrt/Core/ContribImportBinding.h ContribImportBinding test_SynthUnit 通过所属接口或集成流程验证
synthrt/include/synthrt/Core/ContribInterpreter.h ContribInterpreter test_SynthUnit、test_InferenceInterpreter 通过所属接口或集成流程验证
synthrt/include/synthrt/Core/ContribInterpreterPlugin.h ContribInterpreterPlugin test_ContribInterpreterPlugin、test_ContribInterpreterPlugin_Dsinfer 直接测试
synthrt/include/synthrt/Core/ContribLocator.h ContribLocator test_ContribLocator 直接测试
synthrt/include/synthrt/Core/ContribSpec.h ContribExports, ContribImportOptions, ContribConfiguration, ContribImportValidator, ContribImport, ContribSpec test_SynthUnit、test_InferenceContrib 通过所属接口或集成流程验证
synthrt/include/synthrt/Core/ContribSpecExtension.h ContribSpecExtension test_SynthUnit、test_DiffSingerProvider 通过所属接口或集成流程验证
synthrt/include/synthrt/Core/ContribSpecPayload.h ContribSpecPayload test_ContribSpecPayload 直接测试
synthrt/include/synthrt/Core/ContribContract.h ContribContract、ContribContractTriplet test_ContribContract 直接测试
synthrt/include/synthrt/Core/PackageHandle.h PackageDependency, PackageHandle test_PackageHandle 直接测试
synthrt/include/synthrt/Core/RuntimeService.h RuntimeService test_RuntimeService 直接测试
synthrt/include/synthrt/Core/SynthUnit.h SynthUnit test_SynthUnit 直接测试
synthrt/include/synthrt/Support/DisplayText.h DisplayText test_DisplayText 直接测试
synthrt/include/synthrt/Support/Error.h Error test_Error 直接测试
synthrt/include/synthrt/Support/Expected.h Expected test_Expected 直接测试
synthrt/include/synthrt/SVS/InferenceContrib.h InferenceSpec, InferenceCategory test_InferenceContrib 直接测试
synthrt/include/synthrt/SVS/InferenceExecutive.h InferenceRuntimeOptions, InferenceInitArgs, InferenceExecutive test_AcousticInference、test_PitchInference、test_VarianceInference、test_DurationInference、test_VocoderInference 通过所属接口或集成流程验证
synthrt/include/synthrt/SVS/InferenceInterpreter.h InferenceInterpreter test_InferenceInterpreter 直接测试
synthrt/include/synthrt/SVS/InferenceInterpreterPlugin.h InferenceInterpreterPlugin test_InferenceContrib、test_DurationInterpreter 通过所属接口或集成流程验证
synthrt/include/synthrt/SVS/SingerContrib.h SingerSpec, SingerCategory test_SingerContrib、test_InferenceContrib 通过所属接口或集成流程验证
synthrt/include/synthrt/SVS/SingerPipelineExecutive.h SingerPipelineRuntimeOptions, SingerPipelineExtension, SingerPipelineExecutive test_DiffSingerPipelineExecutive、test_DiffSingerProvider 通过所属接口或集成流程验证
synthrt/include/synthrt/SVS/SingerProvider.h SingerProvider test_DiffSingerProvider 通过所属接口或集成流程验证
synthrt/include/synthrt/SVS/SingerProviderPlugin.h SingerProviderPlugin test_DiffSingerProvider_Compatibility 通过所属接口或集成流程验证
synthrt/include/synthrt/Task/ITask.h TaskPayload, TaskInitArgs, TaskStartInput, TaskResult, ITask, TaskStopToken, TaskStopSource, TaskHandle test_ITask 直接测试,覆盖 claim、handle、stop token、取消、callback 再启动/销毁/异常和等待屏障
synthrt/lib/Core/ContribCategory_p.h ContribCreateContext::Data, ContribCategory::Impl test_ContribCategory、test_SynthUnit 通过所属接口或集成流程验证
synthrt/lib/Core/ContribPluginFactory_p.h ContribPluginFactory test_SynthUnit、test_ContribInterpreterPlugin 通过所属接口或集成流程验证
synthrt/lib/Core/ContribSpec_p.h ContribImport::Data, ContribSpec::Impl test_SynthUnit、test_InferenceContrib 通过所属接口或集成流程验证
synthrt/lib/Core/PackageHandle_p.h PackageData test_PackageHandle 直接测试
synthrt/lib/Core/PackageLoader.cpp JsonProfileValidator test_SynthUnit 通过所属接口或集成流程验证
synthrt/lib/Core/PackageLoader_p.h PackageLoader test_SynthUnit 通过所属接口或集成流程验证
synthrt/lib/Core/SynthUnit_p.h SynthUnit::Impl test_SynthUnit 直接测试
synthrt/lib/Support/DisplayText.cpp DisplayText::Impl test_DisplayText 直接测试
synthrt/lib/Support/Error.cpp ErrorCategory test_Error 直接测试
synthrt/lib/SVS/InferenceContrib.cpp InferenceExecutiveFactory test_InferenceContrib 直接测试
synthrt/lib/SVS/InferenceInterpreter.cpp InferenceImportBinding test_InferenceInterpreter 直接测试
synthrt/lib/SVS/SingerProvider.cpp SingerExports, SingerImportOptions, SingerImportBinding test_DiffSingerProvider 通过所属接口或集成流程验证
dsinfer/include/dsinfer/Api/Drivers/Onnx/OnnxDriverApi.h RuntimeApi, DriverInitArgs, SessionOpenArgs, SessionStartInput, SessionResult, DriverExtension test_OnnxDriverApi 直接测试
dsinfer/include/dsinfer/Api/Inferences/Acoustic/1/AcousticApiL1.h Exports, ImportOptions, RuntimeOptions, InitArgs, StartInput, Result, Executive test_AcousticApiL1、test_AcousticInference、test_AcousticTask 通过所属接口或集成流程验证
dsinfer/include/dsinfer/Api/Inferences/Acoustic/1/AcousticOnnxApiL1.h Onnx::Configuration test_AcousticApiL1、test_AcousticInference、test_AcousticTask 通过变体配置和插件测试验证
dsinfer/include/dsinfer/Api/Inferences/Common/1/CommonApiL1.h InputPhonemeInfo, Speaker, InputNoteInfo, InputWordInfo, InputParameterInfo, RetakeRange, InputSpeakerInfo test_CommonApiL1 直接测试
dsinfer/include/dsinfer/Api/Inferences/Duration/1/DurationApiL1.h Exports, ImportOptions, RuntimeOptions, InitArgs, StartInput, Result, Executive test_DurationApiL1、test_DurationInterpreter、test_DurationInference、test_DurationTask 通过所属接口或集成流程验证
dsinfer/include/dsinfer/Api/Inferences/Duration/1/DurationOnnxApiL1.h Onnx::DurationType, Onnx::Configuration test_DurationApiL1、test_DurationInterpreter、test_DurationInference、test_DurationTask 通过变体配置和插件测试验证
dsinfer/include/dsinfer/Api/Inferences/Pitch/1/PitchApiL1.h Exports, ImportOptions, RuntimeOptions, InitArgs, StartInput, Result, Executive test_PitchApiL1、test_PitchInference、test_PitchTask 通过所属接口或集成流程验证
dsinfer/include/dsinfer/Api/Inferences/Pitch/1/PitchOnnxApiL1.h Onnx::Configuration test_PitchApiL1、test_PitchInference、test_PitchTask 通过变体配置和插件测试验证
dsinfer/include/dsinfer/Api/Inferences/Variance/1/VarianceApiL1.h Exports, ImportOptions, RuntimeOptions, InitArgs, StartInput, Result, Executive test_VarianceApiL1、test_VarianceInference、test_VarianceTask 通过所属接口或集成流程验证
dsinfer/include/dsinfer/Api/Inferences/Variance/1/VarianceOnnxApiL1.h Onnx::Configuration test_VarianceApiL1、test_VarianceInference、test_VarianceTask 通过变体配置和插件测试验证
dsinfer/include/dsinfer/Api/Inferences/Vocoder/1/VocoderApiL1.h ImportOptions, RuntimeOptions, Exports, InitArgs, StartInput, Result, Executive test_VocoderApiL1、test_VocoderInference、test_VocoderTask 通过所属接口或集成流程验证
dsinfer/include/dsinfer/Api/Inferences/Vocoder/1/VocoderOnnxApiL1.h Onnx::Configuration test_VocoderApiL1、test_VocoderInference、test_VocoderTask 通过变体配置和插件测试验证
dsinfer/include/dsinfer/Api/Singers/DiffSinger/1/DiffSingerApiL1.h Exports, PipelineRuntimeOptions, PipelineExecutive test_DiffSingerProvider、test_DiffSingerPipelineExecutive 通过所属接口或集成流程验证
dsinfer/include/dsinfer/Api/Singers/DiffSinger/1/DiffSingerOpenVpiApiL1.h OpenVpi::Configuration test_DiffSingerProvider、test_DiffSingerPipelineExecutive 通过变体配置和插件测试验证
dsinfer/include/dsinfer/Core/ParamTag.h ParamTag test_ParamTag 直接测试
dsinfer/include/dsinfer/Core/Tensor.h ITensor, TensorTraits, Tensor test_Tensor 直接测试
dsinfer/include/dsinfer/Inference/InferenceDriver.h InferenceDriverPayload, InferenceDriverInitArgs, InferenceDriverExtension, InferenceDriver test_InferenceDriverFactory、test_InferenceDriverFactory_Plugin、test_OnnxDriverApi 通过所属接口或集成流程验证
dsinfer/include/dsinfer/Inference/InferenceDriverFactory.h InferenceDriverFactory test_InferenceDriverFactory、test_InferenceDriverFactory_Plugin 直接测试
dsinfer/include/dsinfer/Inference/InferenceDriverPlugin.h InferenceDriverPlugin test_InferenceDriverFactory_Plugin 通过所属接口或集成流程验证
dsinfer/include/dsinfer/Inference/InferenceSession.h InferenceSessionOpenArgs, InferenceSessionInitArgs, InferenceSessionStartInput, InferenceSessionResult, InferenceSession test_InferenceSession 直接测试
dsinfer/include/dsinfer/Support/ErrorCode.h 错误码及错误分类 test_ErrorCode 直接测试
dsinfer/include/dsinfer/Support/PackageListConfig.h PackageListItemMetadata, PackageListItem, PackageListConfig test_PackageListConfig 直接测试
dsinfer/include/dsinfer/Support/PhonemeDict.h PhonemeList, iterator, PhonemeDict test_PhonemeDict 直接测试
dsinfer/lib/Support/ErrorCode.cpp ErrorCategory test_ErrorCode 直接测试
dsinfer/lib/Support/PhonemeDict.cpp const_char_hash, const_char_equal, PhonemeDict::Impl, Entry test_PhonemeDict 直接测试
dsinfer/plugins/inferencedrivers/onnxdriver/main.cpp OnnxDriverPlugin test_InferenceDriverFactory_Plugin 通过所属接口或集成流程验证
dsinfer/plugins/inferencedrivers/onnxdriver/OnnxDriver.h OnnxDriver test_InferenceDriverFactory、test_InferenceDriverFactory_Plugin 通过所属接口或集成流程验证
dsinfer/plugins/inferencedrivers/onnxdriver/OnnxSession.h OnnxSession test_InferenceDriverFactory 通过所属接口或集成流程验证
dsinfer/plugins/inferencedrivers/onnxdriver/Runtime/DriverContext.h DriverContext test_Session_Cache、test_InferenceDriverFactory 通过所属接口或集成流程验证
dsinfer/plugins/inferencedrivers/onnxdriver/Runtime/ExecutionProvider_DML.cpp DmlLoadGuard test_InferenceDriverFactory CPU 驱动集成覆盖。GPU 执行受硬件限制
dsinfer/plugins/inferencedrivers/onnxdriver/Runtime/OnnxRuntime.h OnnxRuntime test_InferenceDriverFactory 通过所属接口或集成流程验证
dsinfer/plugins/inferencedrivers/onnxdriver/Session/Session.cpp SessionRunContext, SessionExecutionState, Session::AsyncRun, RunGuard, ModelFileInfo test_Session_Cache 直接测试
dsinfer/plugins/inferencedrivers/onnxdriver/Session/Session.h Session test_Session_Cache 直接测试
dsinfer/plugins/inferencedrivers/onnxdriver/Session/SessionImage.h SessionImage test_Session_Cache 通过所属接口或集成流程验证
dsinfer/plugins/inferencedrivers/onnxdriver/Session/SessionSystem.h SessionSystem, ImageData, ImageGroup, HashSizeKey test_SessionSystem 直接测试
dsinfer/plugins/inferencedrivers/onnxdriver/Utils/ScopedTimer.h ScopedTimer test_ScopedTimer 直接测试
dsinfer/plugins/inferenceinterpreters/acoustic/AcousticInference.h AcousticInference test_AcousticInference 直接测试
dsinfer/plugins/inferenceinterpreters/acoustic/AcousticInterpreter.h AcousticInterpreter test_AcousticInterpreter 直接测试
dsinfer/plugins/inferenceinterpreters/acoustic/AcousticTask.h AcousticTask test_AcousticTask 直接测试
dsinfer/plugins/inferenceinterpreters/acoustic/main.cpp AcousticInterpreterPlugin test_ContribInterpreterPlugin_Dsinfer 通过所属接口或集成流程验证
dsinfer/plugins/inferenceinterpreters/duration/DurationInference.h DurationInference test_DurationInference 直接测试
dsinfer/plugins/inferenceinterpreters/duration/DurationInterpreter.h DurationInterpreter test_DurationInterpreter 直接测试
dsinfer/plugins/inferenceinterpreters/duration/DurationTask.h DurationTask test_DurationTask 直接测试
dsinfer/plugins/inferenceinterpreters/duration/main.cpp DurationInterpreterPlugin test_ContribInterpreterPlugin_Dsinfer 通过所属接口或集成流程验证
dsinfer/plugins/inferenceinterpreters/pitch/main.cpp PitchInterpreterPlugin test_ContribInterpreterPlugin_Dsinfer 通过所属接口或集成流程验证
dsinfer/plugins/inferenceinterpreters/pitch/PitchInference.h PitchInference test_PitchInference 直接测试
dsinfer/plugins/inferenceinterpreters/pitch/PitchInterpreter.h PitchInterpreter test_PitchInterpreter 直接测试
dsinfer/plugins/inferenceinterpreters/pitch/PitchTask.h PitchTask test_PitchTask 直接测试
dsinfer/plugins/inferenceinterpreters/variance/main.cpp VarianceInterpreterPlugin test_ContribInterpreterPlugin_Dsinfer 通过所属接口或集成流程验证
dsinfer/plugins/inferenceinterpreters/variance/VarianceInference.h VarianceInference test_VarianceInference 直接测试
dsinfer/plugins/inferenceinterpreters/variance/VarianceInterpreter.h VarianceInterpreter test_VarianceInterpreter 直接测试
dsinfer/plugins/inferenceinterpreters/variance/VarianceTask.h VarianceTask test_VarianceTask 直接测试
dsinfer/plugins/inferenceinterpreters/vocoder/main.cpp VocoderInterpreterPlugin test_ContribInterpreterPlugin_Dsinfer 通过所属接口或集成流程验证
dsinfer/plugins/inferenceinterpreters/vocoder/VocoderInference.h VocoderInference test_VocoderInference 直接测试
dsinfer/plugins/inferenceinterpreters/vocoder/VocoderInterpreter.h VocoderInterpreter test_VocoderInterpreter 直接测试
dsinfer/plugins/inferenceinterpreters/vocoder/VocoderTask.h VocoderTask test_VocoderTask 直接测试
dsinfer/plugins/singerproviders/diffsinger/DiffSingerPipelineExecutive.h DiffSingerPipelineExecutive test_DiffSingerPipelineExecutive 直接测试
dsinfer/plugins/singerproviders/diffsinger/DiffSingerProvider.cpp DiffSingerImportValidator, DiffSingerPipelineExtension test_DiffSingerProvider、test_DiffSingerProvider_Compatibility 直接测试
dsinfer/plugins/singerproviders/diffsinger/DiffSingerProvider.h DiffSingerProvider test_DiffSingerProvider、test_DiffSingerProvider_Compatibility 直接测试
dsinfer/plugins/singerproviders/diffsinger/main.cpp DiffSingerProviderPlugin test_ContribInterpreterPlugin_Dsinfer 通过所属接口或集成流程验证
dsinfer/util/inferutil/detail/Parser_impl.h ParamTagMappings test_Parser 通过所属接口或集成流程验证
dsinfer/util/inferutil/ErrorCollector.h ErrorCollector test_ErrorCollector 直接测试
dsinfer/util/inferutil/Parser.h ConfigurationParser, SchemaParser, ImportOptionsParser test_Parser 直接测试
dsinfer/util/inferutil/TensorHelper.h TensorHelper test_TensorHelper 直接测试
dsinfer/util/onnxutil/OnnxTensor.h OnnxTensor test_InferenceDriverFactory 通过所属接口或集成流程验证
dsinfer/util/wavfile/WavFile.cpp WavFile::Impl test_WavFile 直接测试
dsinfer/util/wavfile/WavFile.h WavFile, DataFormat test_WavFile 直接测试

手动集成程序

手动程序用于真实 Package 与外部引擎的集成验证,不以 CTest 运行,也不安装。

目标 用途
dsinfer-installer 事务式安装一组已解包的 Package 目录,目标已存在时拒绝覆盖
dsinfer-runner 从 Acoustic 输入 JSON 驱动完整 Singer Pipeline,输出 WAV;可动态加载 wolf 以支持带 linguist Package 的宿主

验证范围与剩余工作

五类推理任务通过记录型后端验证输入张量、参数控制、同步与异步执行、停止复用和模型故障。完整 Singer Pipeline 使用真实插件和记录型后端验证五阶段串联、WAV 输出以及每一阶段失败后的资源释放。后端结果版本和空输出张量的回归测试均先复现缺陷,再随修复通过。输入解析器针对嵌套错误类型及字段路径进行表驱动验证。

Package manifest 的 JSON 预扫描由 test_manifest_limits_json_nesting 覆盖 400 层可加载和 100000 层返回 InvalidFormat 的行为。

Clang 插桩报告用于发现未执行路径。跨模块合并报告仍提示函数数据不匹配,因此不把该报告的百分比作为覆盖率承诺。CUDA、DirectML 需要相应硬件,目前没有执行验证。记录型后端不能验证训练模型的精度。per-import speakerMapping 与 Variance predictions 已由记录型后端验证执行链路,YOUSA 1.65 已用真实模型验证 CPU ONNX 执行链。

otter 的 test_GameGgmlInterpreter_RealEngine 已使用 game.cpp v0.1.3 的 CLI 与 Q8 GGUF 通过。test_TifaGgmlInterpreter_RealEngine 已使用 tifa.cpp v0.1.6 的 CLI、F16 GGUF 与 Mandarin 字典通过。tifa.cpp v0.2.0 不再内建 G2P,现有 provider 传入的 --text-file 与 --dict-dir 已被删除,因此当前适配只覆盖 v0.1.x。迁移到 v0.2.0 需要另行定义音素输入来源。

2026-11-17 契约 API 拆分验证:构建退出码为 0,71 项 CTest 全部通过。test_SynthUnit 的 16 个用例、321 条断言通过,test_InferenceInterpreter 的 2 个用例、33 条断言通过。新增公开变体头文件通过独立编译检查。