Skip to content

Commit 65dfa7b

Browse files
committed
13
1 parent 50f0ed6 commit 65dfa7b

1 file changed

Lines changed: 4 additions & 34 deletions

File tree

test/CMakeLists.txt

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -271,25 +271,10 @@ set_tests_properties(TaskflowLiteTest PROPERTIES
271271
LABELS "unit;taskflowlite"
272272
)
273273

274-
# --- 标签过滤子测试(ctest -R "^tfl\.<tag>$" 即可筛, 不依赖 run_* 目标) ---
275-
set(TFL_TEST_TAGS
276-
flow task executor runtime async semaphore
277-
branch jump subflow observer exception
278-
queue bounded unbounded notifier allocator
279-
pool freestack concepts future container
280-
integration lifecycle stress
281-
)
282-
foreach(tag ${TFL_TEST_TAGS})
283-
add_test(
284-
NAME tfl.${tag}
285-
COMMAND TaskflowLiteTest "[${tag}]" -s -d yes
286-
WORKING_DIRECTORY $<TARGET_FILE_DIR:TaskflowLiteTest>
287-
)
288-
set_tests_properties(tfl.${tag} PROPERTIES
289-
TIMEOUT 600
290-
LABELS "unit;tag-${tag}"
291-
)
292-
endforeach()
274+
# 注: 原先这里按一份硬编码标签清单注册了 tfl.<tag> 子测试 (ctest 跑
275+
# TaskflowLiteTest "[tag]")。但多数 test_*.cpp 并未给用例打对应的 Catch2 标签,
276+
# 导致 "No test cases matched" 而判失败。单体 TaskflowLiteTest 已覆盖全部用例,
277+
# 故移除按标签注册; 需要按标签筛时直接用 Catch2: ./TaskflowLiteTest "[flow]"。
293278

294279
# --- 单文件测试(ctest -R "^tfl_test\.<name>$" 即可筛) ---
295280
foreach(_src ${TFL_TEST_SOURCES})
@@ -330,21 +315,6 @@ add_custom_target(run_all_tests
330315
set_target_properties(run_all_tests PROPERTIES FOLDER "Run")
331316

332317
if(TFL_TEST_RUN_TARGETS)
333-
# --- 标签一键跑 ---
334-
foreach(tag ${TFL_TEST_TAGS})
335-
add_custom_target(run_${tag}_tests
336-
COMMAND ${CMAKE_CTEST_COMMAND}
337-
--output-on-failure
338-
-C $<CONFIG>
339-
-R "^tfl\\.${tag}$"
340-
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
341-
DEPENDS TaskflowLiteTest
342-
USES_TERMINAL
343-
COMMENT "运行 [${tag}] 标签的测试..."
344-
)
345-
set_target_properties(run_${tag}_tests PROPERTIES FOLDER "Run/ByTag")
346-
endforeach()
347-
348318
# --- 单文件一键跑 ---
349319
foreach(_src ${TFL_TEST_SOURCES})
350320
get_filename_component(_full_name "${_src}" NAME_WE)

0 commit comments

Comments
 (0)