提交 c8609551 编写于 作者: K Khaled Hosny

Add API tests to cmake build

上级 f19126dd
cmake_minimum_required(VERSION 2.8.0)
project(harfbuzz)
enable_testing()
## Limit framework build to Xcode generator
if (BUILD_FRAMEWORK)
......@@ -683,3 +684,7 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
endif ()
endif ()
endif ()
# Needs to come last so that variables defined above are passed to
# subdirectories.
add_subdirectory(test)
add_subdirectory(api)
macro (_add_tests)
foreach(test_name ${ARGV})
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${test_name}.c)
add_executable (${test_name} ${test_name}.c)
elseif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${test_name}.cc)
add_executable (${test_name} ${test_name}.cc)
else ()
message(FATAL_ERROR "No source file found for test ${test_name}")
endif ()
target_link_libraries (${test_name} harfbuzz)
add_test (${test_name} ${test_name})
endforeach ()
set_tests_properties (${ARGV} PROPERTIES ENVIRONMENT
"G_TEST_SRCDIR=${CMAKE_CURRENT_SOURCE_DIR};G_TEST_BUILDDIR=${CMAKE_CURRENT_BINARY_DIR}"
)
endmacro ()
if (HB_HAVE_GLIB)
_add_tests (
test-blob
test-buffer
test-common
test-font
test-object
test-set
test-shape
test-unicode
test-version
test-ot-tag
test-c
test-cplusplus
)
if (HB_HAVE_FREETYPE)
_add_tests (
test-ot-math
)
endif (HB_HAVE_FREETYPE)
endif (HB_HAVE_GLIB)
......@@ -27,7 +27,9 @@
#ifndef HB_TEST_H
#define HB_TEST_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <hb-glib.h>
......
......@@ -27,7 +27,9 @@
/* This file tests that all headers can be included from .c files */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <hb.h>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册