成功创建二进制测试程序
ubun22:~/OnnxFlow/build$ ls test
CMakeFiles 'test_alloc[1]_tests.cmake' 'test_layer[1]_tests.cmake' test_tensor
CTestTestfile.cmake test_buffer 'test_layer[2]_include.cmake' 'test_tensor[1]_include.cmake'
Makefile 'test_buffer[1]_include.cmake' 'test_layer[3]_include.cmake' 'test_tensor[1]_tests.cmake'
cmake_install.cmake 'test_buffer[1]_tests.cmake' test_memcpy
test_alloc test_layer 'test_memcpy[1]_include.cmake'
'test_alloc[1]_include.cmake' 'test_layer[1]_include.cmake' 'test_memcpy[1]_tests.cmake'
ubun22:~/OnnxFlow/build$
ctest 不识别(实际添加)
Test #38: TensorTest.ExternalMemoryReshape
Test #39: TensorTest.ElementAccess
Test #40: TensorTest.clone_cpu
Test #41: TensorTest.to_cu
Test #42: TensorTest.init1
Test #43: TensorTest.init3
Test #44: TensorTest.init2
Test #45: TensorTest.assign1
Total Tests: 45
解决方法(实际添加了)
添加顺序:layer 在 tensor 之前添加
-- Test executable created: test_alloc
-- Test executable created: test_buffer
-- Test executable created: test_memcpy
-- Test executable created: test_layer
-- Test executable created: test_tensor
Test #22: BaseLayerTest.ConstructorInitializesMembers
Test #23: BaseLayerTest.PropertySettersModifyState
Test #24: BaseLayerTest.DefaultNameHandling