1macro (_add_tests) 2 foreach(test_name ${ARGV}) 3 if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${test_name}.c) 4 add_executable (${test_name} ${test_name}.c) 5 elseif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${test_name}.cc) 6 add_executable (${test_name} ${test_name}.cc) 7 else () 8 message(FATAL_ERROR "No source file found for test ${test_name}") 9 endif () 10 target_link_libraries (${test_name} harfbuzz) 11 add_test (${test_name} ${test_name}) 12 endforeach () 13 set_tests_properties (${ARGV} PROPERTIES ENVIRONMENT 14 "G_TEST_SRCDIR=${CMAKE_CURRENT_SOURCE_DIR};G_TEST_BUILDDIR=${CMAKE_CURRENT_BINARY_DIR}" 15 ) 16endmacro () 17 18if (HB_HAVE_GLIB) 19 _add_tests ( 20 test-blob 21 test-buffer 22 test-common 23 test-font 24 test-object 25 test-set 26 test-shape 27 test-unicode 28 test-version 29 test-ot-tag 30 test-c 31 test-cplusplus 32 ) 33 34 if (HB_HAVE_FREETYPE) 35 _add_tests ( 36 test-ot-math 37 ) 38 endif (HB_HAVE_FREETYPE) 39endif (HB_HAVE_GLIB) 40