CreateTestList.cmake (673B)
1 function(create_test_list list_name target) 2 set("TEST_LIST_TARGET_${list_name}" ${target} PARENT_SCOPE) 3 endfunction() 4 5 function(write_test_file list_name file) 6 set("TEST_LIST_FILE_${list_name}" ${file} PARENT_SCOPE) 7 file(WRITE ${file} "#define UNIT_TESTS(XX) \\\n") 8 file(APPEND ${file} ${TEST_LIST_CONTENT_${list_name}}) 9 file(APPEND ${file} "\n") 10 endfunction() 11 12 function(create_test list_name unit_name test_name) 13 set(TEST_LIST_CONTENT_${list_name} "${TEST_LIST_CONTENT_${list_name}} XX(${unit_name},${test_name}) \\\n" PARENT_SCOPE) 14 add_test(NAME "${unit_name}_${test_name}" COMMAND ${TEST_LIST_TARGET_${list_name}} ${unit_name} ${test_name}) 15 endfunction()