ci: 引入 ctest 门禁并接入全平台流水线 (#4833)

tests 目录下的程序此前仅被编译、从不执行,项目中也没有任何 add_test 注册,
测试因此会静默腐烂:master 上的 test_vp9_rtp 目前即为失败状态,却无人察觉。

改为以白名单注册可无人值守执行的用例,并在流水线构建之后执行 ctest,
失败即中断。该目录其余程序多为服务型或压测工具,运行后不会自行退出,全量
自动收录会使 ctest 挂起,故采用白名单。

首批收录
test_amf、test_sortor、test_ts_splitter、test_mp4_muxer_video_dimension
四个,均已本地实测通过,总耗时 0.05 秒;并为每个用例设置 120 秒超时,避免
个别用例卡住流水线。

test_vp9_rtp 当前为失败状态,本次不收录,留待单独修复后再并入白名单。

现在先搭好框架, 后续逐个添加单元测试/门禁
This commit is contained in:
YuLi
2026-09-19 19:20:21 -07:00
committed by GitHub
parent b7947723b9
commit 12ba56f534
6 changed files with 47 additions and 0 deletions

View File

@@ -97,6 +97,9 @@ jobs:
cd ../../
mkdir -p linux_build && cd linux_build && cmake .. -DOPENSSL_ROOT_DIR=/root/install -DCMAKE_BUILD_TYPE=Release && make -j $(nproc)
# 执行门禁用例(见 tests/CMakeLists.txt 的 GATING_TESTS),失败则中断流水线
# Run the gating cases (see GATING_TESTS in tests/CMakeLists.txt); a failure breaks the pipeline
ctest --output-on-failure
"
- name: 设置环境变量