Skip to content

【训练营】基于 CTest + gtest 的测试体系搭建与工程化集成#120

Open
luoyueyuguang wants to merge 5 commits intoInfiniTensor:masterfrom
luoyueyuguang:master
Open

【训练营】基于 CTest + gtest 的测试体系搭建与工程化集成#120
luoyueyuguang wants to merge 5 commits intoInfiniTensor:masterfrom
luoyueyuguang:master

Conversation

@luoyueyuguang
Copy link

No description provided.

@chen2021673
Copy link
Contributor

chen2021673 commented Mar 18, 2026

1.请不要用 merge 操作,统一使用 rebase 同步最新修改;
2.请补充 PR description;
3.请解决目前 pr 与 master 分支的冲突。

add_subdirectory(third_party/glog)
add_compile_definitions(GLOG_USE_GLOG_EXPORT=1)
include_directories(${glog_SOURCE_DIR}/src)
include_directories(${glog_BINARY_DIR}/glog)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里是否可以删除

file(GLOB_RECURSE SRC ${PROJECT_SOURCE_DIR}/infini_train/src/*.cc)
list(FILTER SRC EXCLUDE REGEX ".*kernels/cpu/.*")
list(FILTER SRC EXCLUDE REGEX ".*runtime/cuda/.*")
list(FILTER SRC EXCLUDE REGEX ".*ccl/cuda/.*")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的逻辑应该是

if(NOT USE_CUDA)
  list(FILTER SRC EXCLUDE REGEX ".*runtime/cuda/.*")
  list(FILTER SRC EXCLUDE REGEX ".*ccl/cuda/.*")
endif()

否则会出现编译错误

@@ -0,0 +1,161 @@
# Autograd tests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这版的风险是新增测试的接入成本和漏配风险都比较高。新增一个普通 autograd CPU 测试,至少要手动写:

add_autograd_test(...)
add_test(...)
set_tests_properties(... LABELS ...)

建议简化。例如把功能整合到一个函数里,新增测试只调用一次;或者考虑使用gtest_discover_tests,不用再手工写 add_test() 和 set_tests_properties()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants