diff options
Diffstat (limited to 'libs/cargs/cmake/CreateTestList.cmake')
-rw-r--r-- | libs/cargs/cmake/CreateTestList.cmake | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libs/cargs/cmake/CreateTestList.cmake b/libs/cargs/cmake/CreateTestList.cmake new file mode 100644 index 0000000..2dd46b3 --- /dev/null +++ b/libs/cargs/cmake/CreateTestList.cmake @@ -0,0 +1,11 @@ +function(create_test_list list_name file)
+ set("TEST_LIST_FILE_${list_name}" ${file} PARENT_SCOPE)
+ file(WRITE ${file} "#define UNIT_TESTS(XX) \\\n")
+ file(APPEND ${file} ${TEST_LIST_CONTENT_${list_name}})
+ file(APPEND ${file} "\n")
+endfunction()
+
+function(create_test list_name unit_name test_name)
+ set(TEST_LIST_CONTENT_${list_name} "${TEST_LIST_CONTENT_${list_name}} XX(${unit_name},${test_name}) \\\n" PARENT_SCOPE)
+ add_test(NAME "${unit_name}_${test_name}" COMMAND ${TEST_TARGET} ${unit_name} ${test_name})
+endfunction()
\ No newline at end of file |