[HarfBuzz] harfbuzz-ng: Branch 'master' - 11 commits

Behdad Esfahbod behdad at kemper.freedesktop.org
Fri May 27 00:50:51 PDT 2011


 COPYING             |    1 
 Makefile.am         |    2 
 NEWS                |  262 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 README              |    8 -
 TODO                |    2 
 configure.ac        |   30 ++++-
 src/Makefile.am     |    1 
 src/hb-ot-shape.cc  |    4 
 test/Makefile.am    |   73 ++++++++++++++
 test/Makefile.decl  |   90 -----------------
 test/test-common.c  |    6 +
 test/test-shape.c   |    2 
 test/test-unicode.c |    2 
 test/test-version.c |   80 +++++++++++++++
 14 files changed, 455 insertions(+), 108 deletions(-)

New commits:
commit f24557604281356131618546332d7ee3a0c8abef
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed May 25 16:08:06 2011 -0400

    Release 0.6.0.  First official tarball release!
    
    There are no API guarantees just yet, but I *expect* that no
    incompatible API changes to happen before 1.0.0.
    
    Update NEWS.

diff --git a/NEWS b/NEWS
index e69de29..d31c548 100644
--- a/NEWS
+++ b/NEWS
@@ -0,0 +1,262 @@
+Overview of changes leading to 0.6.0
+Friday, May 27, 2011
+====================================
+
+- Vertical text support in GPOS
+- Almost all API entries have unit tests now, under test/
+- All thread-safety issues are fixed
+
+Summary of API changes follows.
+
+
+* Simple Types API:
+
+  o New API:
+    HB_LANGUAGE_INVALID
+    hb_language_get_default()
+    hb_direction_to_string()
+    hb_direction_from_string()
+    hb_script_get_horizontal_direction()
+    HB_UNTAG()
+
+  o Renamed API:
+    hb_category_t renamed to hb_unicode_general_category_t
+
+  o Changed API:
+    hb_language_t is a typed pointers now
+
+  o Removed API:
+    HB_TAG_STR()
+
+
+* Use ISO 15924 tags for hb_script_t:
+
+  o New API:
+    hb_script_from_iso15924_tag()
+    hb_script_to_iso15924_tag()
+    hb_script_from_string()
+
+  o Changed API:
+    HB_SCRIPT_* enum members changed value.
+
+
+* Buffer API streamlined:
+
+  o New API:
+    hb_buffer_reset()
+    hb_buffer_set_length()
+    hb_buffer_allocation_successful()
+
+  o Renamed API:
+    hb_buffer_ensure() renamed to hb_buffer_pre_allocate()
+    hb_buffer_add_glyph() renamed to hb_buffer_add()
+
+  o Removed API:
+    hb_buffer_clear()
+    hb_buffer_clear_positions()
+
+  o Changed API:
+    hb_buffer_get_glyph_infos() takes an out length parameter now
+    hb_buffer_get_glyph_positions() takes an out length parameter now
+
+
+* Blob API streamlined:
+
+  o New API:
+    hb_blob_get_data()
+    hb_blob_get_data_writable()
+
+  o Renamed API:
+    hb_blob_create_empty() renamed to hb_blob_get_empty()
+
+  o Removed API:
+    hb_blob_lock()
+    hb_blob_unlock()
+    hb_blob_is_writable()
+    hb_blob_try_writable()
+
+  o Changed API:
+    hb_blob_create() takes user_data before destroy now
+
+
+* Unicode functions API:
+
+  o Unicode function vectors can subclass other unicode function vectors now.
+    Unimplemented callbacks in the subclass automatically chainup to the parent.
+
+  o All hb_unicode_funcs_t callbacks take a user_data now.  Their setters
+    take a user_data and its respective destroy callback.
+
+  o New API:
+    hb_unicode_funcs_get_empty()
+    hb_unicode_funcs_get_default()
+    hb_unicode_funcs_get_parent()
+
+  o Changed API:
+    hb_unicode_funcs_create() now takes a parent_funcs.
+
+  o Removed func getter functions:
+    hb_unicode_funcs_get_mirroring_func()
+    hb_unicode_funcs_get_general_category_func()
+    hb_unicode_funcs_get_script_func()
+    hb_unicode_funcs_get_combining_class_func()
+    hb_unicode_funcs_get_eastasian_width_func()
+
+
+* Face API:
+
+  o Renamed API:
+    hb_face_get_table() renamed to hb_face_reference_table()
+    hb_face_create_for_data() renamed to hb_face_create()
+
+  o Changed API:
+    hb_face_create_for_tables() takes user_data before destroy now
+    hb_face_reference_table() returns empty blob instead of NULL
+    hb_get_table_func_t accepts the face as first parameter now
+
+* Font API:
+
+  o Fonts can subclass other fonts now.  Unimplemented callbacks in the
+    subclass automatically chainup to the parent.  When chaining up,
+    scale is adjusted if the parent font has a different scale.
+
+  o All hb_font_funcs_t callbacks take a user_data now.  Their setters
+    take a user_data and its respective destroy callback.
+
+  o New API:
+    hb_font_get_parent()
+    hb_font_funcs_get_empty()
+    hb_font_create_sub_font()
+
+  o Removed API:
+    hb_font_funcs_copy()
+    hb_font_unset_funcs()
+
+  o Removed func getter functions:
+    hb_font_funcs_get_glyph_func()
+    hb_font_funcs_get_glyph_advance_func()
+    hb_font_funcs_get_glyph_extents_func()
+    hb_font_funcs_get_contour_point_func()
+    hb_font_funcs_get_kerning_func()
+
+  o Changed API:
+    hb_font_create() takes a face and references it now
+    hb_font_set_funcs() takes user_data before destroy now
+    hb_font_set_scale() accepts signed integers now
+    hb_font_get_contour_point_func_t now takes glyph first, then point_index
+    hb_font_get_glyph_func_t returns a success boolean now
+
+
+* Changed object model:
+
+  o All object types have a _get_empty() now:
+    hb_blob_get_empty()
+    hb_buffer_get_empty()
+    hb_face_get_empty()
+    hb_font_get_empty()
+    hb_font_funcs_get_empty()
+    hb_unicode_funcs_get_empty()
+
+  o Added _set_user_data() and _get_user_data() for all object types:
+    hb_blob_get_user_data()
+    hb_blob_set_user_data()
+    hb_buffer_get_user_data()
+    hb_buffer_set_user_data()
+    hb_face_get_user_data()
+    hb_face_set_user_data()
+    hb_font_funcs_get_user_data()
+    hb_font_funcs_set_user_data()
+    hb_font_get_user_data()
+    hb_font_set_user_data()
+    hb_unicode_funcs_get_user_data()
+    hb_unicode_funcs_set_user_data()
+
+  o Removed the _get_reference_count() from all object types:
+    hb_blob_get_reference_count()
+    hb_buffer_get_reference_count()
+    hb_face_get_reference_count()
+    hb_font_funcs_get_reference_count()
+    hb_font_get_reference_count()
+    hb_unicode_funcs_get_reference_count()
+
+  o Added _make_immutable() and _is_immutable() for all object types except for buffer:
+    hb_blob_make_immutable()
+    hb_blob_is_immutable()
+    hb_face_make_immutable()
+    hb_face_is_immutable()
+
+
+* Changed API for vertical text support
+
+  o The following callbacks where removed:
+    hb_font_get_glyph_advance_func_t
+    hb_font_get_kerning_func_t
+
+  o The following new callbacks added instead:
+    hb_font_get_glyph_h_advance_func_t
+    hb_font_get_glyph_v_advance_func_t
+    hb_font_get_glyph_h_origin_func_t
+    hb_font_get_glyph_v_origin_func_t
+    hb_font_get_glyph_h_kerning_func_t
+    hb_font_get_glyph_v_kerning_func_t
+
+  o The following API removed as such:
+    hb_font_funcs_set_glyph_advance_func()
+    hb_font_funcs_set_kerning_func()
+    hb_font_get_glyph_advance()
+    hb_font_get_kerning()
+
+  o New API added instead:
+    hb_font_funcs_set_glyph_h_advance_func()
+    hb_font_funcs_set_glyph_v_advance_func()
+    hb_font_funcs_set_glyph_h_origin_func()
+    hb_font_funcs_set_glyph_v_origin_func()
+    hb_font_funcs_set_glyph_h_kerning_func()
+    hb_font_funcs_set_glyph_v_kerning_func()
+    hb_font_get_glyph_h_advance()
+    hb_font_get_glyph_v_advance()
+    hb_font_get_glyph_h_origin()
+    hb_font_get_glyph_v_origin()
+    hb_font_get_glyph_h_kerning()
+    hb_font_get_glyph_v_kerning()
+
+  o The following higher-leve API added for convenience:
+    hb_font_get_glyph_advance_for_direction()
+    hb_font_get_glyph_origin_for_direction()
+    hb_font_add_glyph_origin_for_direction()
+    hb_font_subtract_glyph_origin_for_direction()
+    hb_font_get_glyph_kerning_for_direction()
+    hb_font_get_glyph_extents_for_origin()
+    hb_font_get_glyph_contour_point_for_origin()
+
+
+* OpenType Layout API:
+
+  o New API:
+    hb_ot_layout_position_start()
+    hb_ot_layout_substitute_start()
+    hb_ot_layout_substitute_finish()
+
+
+* Glue code:
+
+  o New API:
+    hb_glib_script_to_script()
+    hb_glib_script_from_script()
+    hb_icu_script_to_script()
+    hb_icu_script_from_script()
+
+
+* Version API added:
+
+  o New API:
+    HB_VERSION_MAJOR
+    HB_VERSION_MINOR
+    HB_VERSION_MICRO
+    HB_VERSION_STRING
+    HB_VERSION_CHECK()
+    hb_version()
+    hb_version_string()
+    hb_version_check()
+
+
diff --git a/configure.ac b/configure.ac
index e8bf009..372c9f2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
 AC_PREREQ([2.64])
 AC_INIT([harfbuzz],
-        [0.5.0],
+        [0.6.0],
         [http://bugs.freedesktop.org/enter_bug.cgi?product=harfbuzz],
         [harfbuzz],
         [http://harfbuzz.org/])
commit 654f88fbc9bcb54f9bd2d5586236234e03424044
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Fri May 27 03:38:46 2011 -0400

    [test-common] Test hb_direction_to_string()
    
    Caught by "make check-symbols".

diff --git a/test/test-common.c b/test/test-common.c
index a75138c..d5cbfc7 100644
--- a/test/test-common.c
+++ b/test/test-common.c
@@ -87,6 +87,12 @@ test_types_direction (void)
   g_assert_cmpint (HB_DIRECTION_RTL, ==, hb_direction_from_string ("RtL"));
   g_assert_cmpint (HB_DIRECTION_RTL, ==, hb_direction_from_string ("right-to-left"));
   g_assert_cmpint (HB_DIRECTION_TTB, ==, hb_direction_from_string ("ttb"));
+
+  g_assert (0 == strcmp ("ltr", hb_direction_to_string (HB_DIRECTION_LTR)));
+  g_assert (0 == strcmp ("rtl", hb_direction_to_string (HB_DIRECTION_RTL)));
+  g_assert (0 == strcmp ("ttb", hb_direction_to_string (HB_DIRECTION_TTB)));
+  g_assert (0 == strcmp ("btt", hb_direction_to_string (HB_DIRECTION_BTT)));
+  g_assert (0 == strcmp ("invalid", hb_direction_to_string (HB_DIRECTION_INVALID)));
 }
 
 static void
commit 18bced134fc3379c9124ba029e22ff3f6434ca0f
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Fri May 27 03:38:30 2011 -0400

    [test] Rename test-symbols to check-symbols
    
    Shows undocumented symbols.

diff --git a/test/Makefile.am b/test/Makefile.am
index 46b21be..4cbc590 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -51,21 +51,7 @@ test_object_LIBS = $(LDADD) $(FREETYPE_LIBS)
 endif
 
 
-# test-symbols: Finds untested API symbols
-symbols-tested.txt: $(TEST_PROGS)
-	$(AM_V_GEN)$(top_builddir)/libtool --mode=execute nm $^ \
-	| grep ' U hb_' | sed 's/.* U hb_/hb_/' \
-	| sort | uniq > $@.tmp && mv $@.tmp $@
-symbols-exported.txt: $(top_builddir)/src/.libs/libharfbuzz.so
-	$(AM_V_GEN)$(top_builddir)/libtool --mode=execute nm $^ \
-	| grep ' T ' | sed 's/.* T //' | grep -v '^\(_init\|_fini\)$$' \
-	| sort | uniq > $@.tmp && mv $@.tmp $@
-symbols-untested.txt: symbols-tested.txt symbols-exported.txt
-	$(AM_V_GEN)diff $^ > $@.tmp; mv $@.tmp $@
-CLEANFILES += symbols-tested.txt symbols-exported.txt symbols-untested.txt
-test-symbols: symbols-untested.txt
-	@! cat $^ | grep .
-
+# Default test running environment
 TESTS = $(TEST_PROGS)
 TESTS_ENVIRONMENT = \
 	MALLOC_CHECK_=2 \
@@ -74,6 +60,7 @@ TESTS_ENVIRONMENT = \
 	G_SLICE=always-malloc \
 	$(ENV)
 
+
 # check-tool: Run tests under $(TOOL)
 check-tool:
 	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) check \
@@ -90,6 +77,7 @@ GTESTER = gtester
 check-gtester:
 	$(AM_V_at)$(MAKE) $(AM_MAKEFLGS) check-tool-raw TOOL="$(GTESTER) --verbose"
 
+
 # Check tests under valgrind.  Saves log to valgrind-log
 VALGRIND_FLAGS = \
 	--tool=memcheck --suppressions=$(srcdir)/.valgrind-suppressions \
@@ -108,12 +96,29 @@ check-valgrind:
 	2>&1 | tee valgrind-log $(valgrind_verbose)
 
 
+# check-symbols: Finds untested API symbols
+symbols-tested.txt: $(TEST_PROGS)
+	$(AM_V_GEN)$(top_builddir)/libtool --mode=execute nm $^ \
+	| grep ' U hb_' | sed 's/.* U hb_/hb_/' \
+	| sort | uniq > $@.tmp && mv $@.tmp $@
+symbols-exported.txt: $(top_builddir)/src/.libs/libharfbuzz.so
+	$(AM_V_GEN)$(top_builddir)/libtool --mode=execute nm $^ \
+	| grep ' T ' | sed 's/.* T //' | grep -v '^\(_init\|_fini\)$$' \
+	| sort | uniq > $@.tmp && mv $@.tmp $@
+symbols-untested.txt: symbols-tested.txt symbols-exported.txt
+	$(AM_V_GEN)diff $^ > $@.tmp; mv $@.tmp $@
+CLEANFILES += symbols-tested.txt symbols-exported.txt symbols-untested.txt
+check-symbols: symbols-untested.txt
+	@! cat $^ | grep .
+
+
+
 else
 check-am:
 	@echo "You need to have glib support enabled to run the tests"
 	@exit 77
 endif
 
-.PHONY: test-symbols check-tool check-valgrind
+.PHONY: check-symbols check-tool check-valgrind
 
 -include $(top_srcdir)/git.mk
commit 376dafa6ed414e368e9dc1d5a2e0bfc8e55f410d
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Fri May 27 03:35:58 2011 -0400

    Hide internal symbols

diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc
index f78c29b..02be237 100644
--- a/src/hb-ot-shape.cc
+++ b/src/hb-ot-shape.cc
@@ -377,7 +377,7 @@ hb_ot_shape_execute_internal (hb_ot_shape_context_t *c)
   c->buffer->props.direction = c->target_direction;
 }
 
-void
+static void
 hb_ot_shape_plan_internal (hb_ot_shape_plan_t       *plan,
 			   hb_face_t                *face,
 			   const hb_segment_properties_t  *props,
@@ -391,7 +391,7 @@ hb_ot_shape_plan_internal (hb_ot_shape_plan_t       *plan,
   plan->map.compile (face, props);
 }
 
-void
+static void
 hb_ot_shape_execute (hb_ot_shape_plan_t *plan,
 		     hb_font_t          *font,
 		     hb_buffer_t        *buffer,
commit 0e482ec6ba30b613f2d7ee97c61be458c5aebcd6
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Fri May 27 02:46:28 2011 -0400

    [test/unicode] Fix double-free
    
    Caught by "make check-valgrind".

diff --git a/test/Makefile.am b/test/Makefile.am
index 4d6c460..46b21be 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -102,7 +102,7 @@ valgrind_verbose = $(valgrind_verbose_$(V))
 valgrind_verbose_ = $(valgrind_verbose_$(AM_DEFAULT_VERBOSITY))
 valgrind_verbose_0 = | \
 	grep '\(^[^=]\|ERROR SUMMARY\|definitely lost\|indirectly lost\)' | grep -v ': 0'
-
+# TODO: The following check does not fail if valgrind finds error.  It should.
 check-valgrind:
 	$(AM_V_at)$(MAKE) $(AM_MAKEFLGS) check-tool TOOL="valgrind $(VALGRIND_FLAGS)" \
 	2>&1 | tee valgrind-log $(valgrind_verbose)
diff --git a/test/test-unicode.c b/test/test-unicode.c
index e163aba..cce4fd2 100644
--- a/test/test-unicode.c
+++ b/test/test-unicode.c
@@ -633,8 +633,6 @@ test_unicode_setters (void)
     g_assert (data[0].freed && !data[1].freed);
     hb_unicode_funcs_destroy (uf);
     g_assert (data[0].freed && !data[1].freed);
-
-    hb_unicode_funcs_destroy (uf);
   }
 }
 
commit 28b1bac5415774cf892c9cc0afcac1324c2093f5
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Fri May 27 02:44:29 2011 -0400

    [test] Switch to automake-based test-runner
    
    Adds check-valgrind among other modes.  We do not run under gtester by
    default anymore.

diff --git a/Makefile.am b/Makefile.am
index 446c18a..12a42e6 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,3 +1,5 @@
+# Process this file with automake to produce Makefile.in
+
 NULL =
 
 SUBDIRS = src test
diff --git a/test/.valgrind-suppressions b/test/.valgrind-suppressions
new file mode 100644
index 0000000..e69de29
diff --git a/test/Makefile.am b/test/Makefile.am
index 63f1396..4d6c460 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,6 +1,7 @@
-include Makefile.decl
+# Process this file with automake to produce Makefile.in
 
 NULL =
+EXTRA_DIST =
 CLEANFILES =
 DISTCLEANFILES =
 MAINTAINERCLEANFILES =
@@ -14,7 +15,7 @@ EXTRA_DIST += hb-test.h
 check_PROGRAMS = $(TEST_PROGS)
 noinst_PROGRAMS = $(TEST_PROGS)
 
-TEST_PROGS += \
+TEST_PROGS = \
 	test-blob \
 	test-buffer \
 	test-common \
@@ -65,6 +66,47 @@ CLEANFILES += symbols-tested.txt symbols-exported.txt symbols-untested.txt
 test-symbols: symbols-untested.txt
 	@! cat $^ | grep .
 
+TESTS = $(TEST_PROGS)
+TESTS_ENVIRONMENT = \
+	MALLOC_CHECK_=2 \
+	MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) \
+	G_DEBUG=gc-friendly \
+	G_SLICE=always-malloc \
+	$(ENV)
+
+# check-tool: Run tests under $(TOOL)
+check-tool:
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) check \
+	TESTS_ENVIRONMENT='$(TESTS_ENVIRONMENT) $(top_builddir)/libtool --mode=execute \
+	env $(TOOL)'
+# check-tool-raw: Run tests under $(TOOL), but don't run under libtool
+check-tool-raw:
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) check \
+	TESTS_ENVIRONMENT='$(TESTS_ENVIRONMENT) \
+	env $(TOOL)'
+
+# check-gtester: Run tests under gtester
+GTESTER = gtester
+check-gtester:
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLGS) check-tool-raw TOOL="$(GTESTER) --verbose"
+
+# Check tests under valgrind.  Saves log to valgrind-log
+VALGRIND_FLAGS = \
+	--tool=memcheck --suppressions=$(srcdir)/.valgrind-suppressions \
+	--track-origins=yes \
+	--leak-check=yes
+	$(EXTRA_VALGRIND_FLAGS)
+#	Can't do for now: --show-reachable=yes
+CLEANFILES +=  valgrind-log
+valgrind_verbose = $(valgrind_verbose_$(V))
+valgrind_verbose_ = $(valgrind_verbose_$(AM_DEFAULT_VERBOSITY))
+valgrind_verbose_0 = | \
+	grep '\(^[^=]\|ERROR SUMMARY\|definitely lost\|indirectly lost\)' | grep -v ': 0'
+
+check-valgrind:
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLGS) check-tool TOOL="valgrind $(VALGRIND_FLAGS)" \
+	2>&1 | tee valgrind-log $(valgrind_verbose)
+
 
 else
 check-am:
@@ -72,6 +114,6 @@ check-am:
 	@exit 77
 endif
 
-.PHONY: test-symbols
+.PHONY: test-symbols check-tool check-valgrind
 
 -include $(top_srcdir)/git.mk
diff --git a/test/Makefile.decl b/test/Makefile.decl
deleted file mode 100644
index c226169..0000000
--- a/test/Makefile.decl
+++ /dev/null
@@ -1,90 +0,0 @@
-GTESTER = gtester 			# for non-GLIB packages
-#GTESTER = $(top_builddir)/glib/gtester			# for the GLIB package
-#GTESTER_REPORT = $(top_builddir)/glib/gtester-report	# for the GLIB package
-
-# initialize variables for unconditional += appending
-EXTRA_DIST =
-TEST_PROGS =
-
-### testing rules
-
-# test: run all tests in cwd and subdirs
-test: test-nonrecursive
-	@ for subdir in $(SUBDIRS) . ; do \
-	    test "$$subdir" = "." -o "$$subdir" = "po" || \
-	    ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \
-	  done
-
-# test-nonrecursive: run tests only in cwd
-test-nonrecursive: ${TEST_PROGS}
-	@test -z "${TEST_PROGS}" || MALLOC_CHECK_=2 MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) ${GTESTER} --verbose ${TEST_PROGS}
-
-# test-report: run tests in subdirs and generate report
-# perf-report: run tests in subdirs with -m perf and generate report
-# full-report: like test-report: with -m perf and -m slow
-test-report perf-report full-report:	${TEST_PROGS}
-	@test -z "${TEST_PROGS}" || { \
-	  case $@ in \
-	  test-report) test_options="-k";; \
-	  perf-report) test_options="-k -m=perf";; \
-	  full-report) test_options="-k -m=perf -m=slow";; \
-	  esac ; \
-	  if test -z "$$GTESTER_LOGDIR" ; then	\
-	    ${GTESTER} --verbose $$test_options -o test-report.xml ${TEST_PROGS} ; \
-	  elif test -n "${TEST_PROGS}" ; then \
-	    ${GTESTER} --verbose $$test_options -o `mktemp "$$GTESTER_LOGDIR/log-XXXXXX"` ${TEST_PROGS} ; \
-	  fi ; \
-	}
-	@ ignore_logdir=true ; \
-	  if test -z "$$GTESTER_LOGDIR" ; then \
-	    GTESTER_LOGDIR=`mktemp -d "\`pwd\`/.testlogs-XXXXXX"`; export GTESTER_LOGDIR ; \
-	    ignore_logdir=false ; \
-	  fi ; \
-	  if test -d "$(top_srcdir)/.git" ; then \
-	    REVISION=`git describe` ; \
-	  else \
-	    REVISION=$(VERSION) ; \
-	  fi ; \
-	  for subdir in $(SUBDIRS) . ; do \
-	    test "$$subdir" = "." -o "$$subdir" = "po" || \
-	    ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \
-	  done ; \
-	  $$ignore_logdir || { \
-	    echo '<?xml version="1.0"?>'              > $@.xml ; \
-	    echo '<report-collection>'               >> $@.xml ; \
-	    echo '<info>'                            >> $@.xml ; \
-	    echo '  <package>$(PACKAGE)</package>'   >> $@.xml ; \
-	    echo '  <version>$(VERSION)</version>'   >> $@.xml ; \
-	    echo "  <revision>$$REVISION</revision>" >> $@.xml ; \
-	    echo '</info>'                           >> $@.xml ; \
-	    for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \
-	      sed '1,1s/^<?xml\b[^>?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \
-	    done ; \
-	    echo >> $@.xml ; \
-	    echo '</report-collection>' >> $@.xml ; \
-	    rm -rf "$$GTESTER_LOGDIR"/ ; \
-	    ${GTESTER_REPORT} --version 2>/dev/null 1>&2 ; test "$$?" != 0 || ${GTESTER_REPORT} $@.xml >$@.html ; \
-	  }
-.PHONY: test test-report perf-report full-report test-nonrecursive
-
-.PHONY: lcov genlcov lcov-clean
-# use recursive makes in order to ignore errors during check
-lcov:
-	-$(MAKE) $(AM_MAKEFLAGS) -k check
-	$(MAKE) $(AM_MAKEFLAGS) genlcov
-
-# we have to massage the lcov.info file slightly to hide the effect of libtool
-# placing the objects files in the .libs/ directory separate from the *.c
-# we also have to delete tests/.libs/libmoduletestplugin_*.gcda
-genlcov:
-	rm -f $(top_builddir)/tests/.libs/libmoduletestplugin_*.gcda
-	$(LTP) --directory $(top_builddir) --capture --output-file glib-lcov.info --test-name GLIB_PERF --no-checksum --compat-libtool
-	LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory glib-lcov --title "GLib Code Coverage" --legend --show-details glib-lcov.info
-
-lcov-clean:
-	-$(LTP) --directory $(top_builddir) -z
-	-rm -rf glib-lcov.info glib-lcov
-	-find -name '*.gcda' -print | xargs rm
-
-# run tests in cwd as part of make check
-check-local: test-nonrecursive
commit adbc97ddde27cf609d95d3249f3ea8060a6e1d20
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Fri May 27 01:33:18 2011 -0400

    [test] Add test-symbols that checks API symbol text coverage
    
    We're not at 100% coverage yet, so do not enable the test by default.

diff --git a/test/Makefile.am b/test/Makefile.am
index bfa423b..63f1396 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,6 +1,9 @@
 include Makefile.decl
 
 NULL =
+CLEANFILES =
+DISTCLEANFILES =
+MAINTAINERCLEANFILES =
 
 if HAVE_GLIB
 AM_CPPFLAGS = -I$(top_srcdir)/src/ $(GLIB_CFLAGS) $(GTHREAD_CFLAGS)
@@ -47,10 +50,28 @@ test_object_LIBS = $(LDADD) $(FREETYPE_LIBS)
 endif
 
 
+# test-symbols: Finds untested API symbols
+symbols-tested.txt: $(TEST_PROGS)
+	$(AM_V_GEN)$(top_builddir)/libtool --mode=execute nm $^ \
+	| grep ' U hb_' | sed 's/.* U hb_/hb_/' \
+	| sort | uniq > $@.tmp && mv $@.tmp $@
+symbols-exported.txt: $(top_builddir)/src/.libs/libharfbuzz.so
+	$(AM_V_GEN)$(top_builddir)/libtool --mode=execute nm $^ \
+	| grep ' T ' | sed 's/.* T //' | grep -v '^\(_init\|_fini\)$$' \
+	| sort | uniq > $@.tmp && mv $@.tmp $@
+symbols-untested.txt: symbols-tested.txt symbols-exported.txt
+	$(AM_V_GEN)diff $^ > $@.tmp; mv $@.tmp $@
+CLEANFILES += symbols-tested.txt symbols-exported.txt symbols-untested.txt
+test-symbols: symbols-untested.txt
+	@! cat $^ | grep .
+
+
 else
 check-am:
 	@echo "You need to have glib support enabled to run the tests"
 	@exit 77
 endif
 
+.PHONY: test-symbols
+
 -include $(top_srcdir)/git.mk
commit 9313b9aa66a82fd3fa60d8417c22a5350e5a8791
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Fri May 27 01:00:55 2011 -0400

    [test/version] Test hb-version.h

diff --git a/test/Makefile.am b/test/Makefile.am
index 973d6b4..bfa423b 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -19,6 +19,7 @@ TEST_PROGS += \
 	test-object \
 	test-shape \
 	test-unicode \
+	test-version \
 	$(NULL)
 
 TEST_PROGS += \
diff --git a/test/test-version.c b/test/test-version.c
new file mode 100644
index 0000000..4c9bd37
--- /dev/null
+++ b/test/test-version.c
@@ -0,0 +1,80 @@
+/*
+ * Copyright © 2011  Google, Inc.
+ *
+ *  This is part of HarfBuzz, a text shaping library.
+ *
+ * Permission is hereby granted, without written agreement and without
+ * license or royalty fees, to use, copy, modify, and distribute this
+ * software and its documentation for any purpose, provided that the
+ * above copyright notice and the following two paragraphs appear in
+ * all copies of this software.
+ *
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
+ * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
+ * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
+ * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
+ * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
+ * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ *
+ * Google Author(s): Behdad Esfahbod
+ */
+
+#include "hb-test.h"
+
+/* Unit tests for hb-version.h */
+
+
+static void
+test_version (void)
+{
+  unsigned int major, minor, micro;
+  char *s;
+
+  hb_version (&major, &minor, &micro);
+
+  g_assert_cmpint (major, ==, HB_VERSION_MAJOR);
+  g_assert_cmpint (minor, ==, HB_VERSION_MINOR);
+  g_assert_cmpint (micro, ==, HB_VERSION_MICRO);
+
+  s = g_strdup_printf ("%u.%u.%u", major, minor, micro);
+  g_assert (0 == strcmp (HB_VERSION_STRING, s));
+  g_free (s);
+  g_assert (0 == strcmp (HB_VERSION_STRING, hb_version_string ()));
+
+  g_assert (HB_VERSION_CHECK (major, minor, micro));
+  g_assert (HB_VERSION_CHECK (major+1, minor, micro));
+  g_assert (HB_VERSION_CHECK (major, minor+1, micro));
+  g_assert (HB_VERSION_CHECK (major, minor, micro+1));
+  if (major)
+    g_assert (!HB_VERSION_CHECK (major-1, minor, micro));
+  if (minor)
+    g_assert (!HB_VERSION_CHECK (major, minor-1, micro));
+  if (micro)
+    g_assert (!HB_VERSION_CHECK (major, minor, micro-1));
+
+  g_assert (hb_version_check (major, minor, micro));
+  g_assert (hb_version_check (major+1, minor, micro));
+  g_assert (hb_version_check (major, minor+1, micro));
+  g_assert (hb_version_check (major, minor, micro+1));
+  if (major)
+    g_assert (!hb_version_check (major-1, minor, micro));
+  if (minor)
+    g_assert (!hb_version_check (major, minor-1, micro));
+  if (micro)
+    g_assert (!hb_version_check (major, minor, micro-1));
+}
+
+int
+main (int argc, char **argv)
+{
+  hb_test_init (&argc, &argv);
+
+  hb_test_add (test_version);
+
+  return hb_test_run();
+}
commit 329c15714be90d3fc2d9054f80cb14fa325dc959
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed May 25 16:07:07 2011 -0400

    Add libtool versioning
    
    The versioning is automatic.  For now, soname-major is 0.  With
    the 1.0.0 release it will jump to 1 and stay there forever.

diff --git a/configure.ac b/configure.ac
index d596ce7..e8bf009 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,17 +21,33 @@ LT_PREREQ([2.2])
 LT_INIT([disable-static])
 
 # Version
-m4_define(version_triplet,m4_split(AC_PACKAGE_VERSION,[[.]]))
-HB_VERSION_MAJOR=m4_argn(1,version_triplet)
-HB_VERSION_MINOR=m4_argn(2,version_triplet)
-HB_VERSION_MICRO=m4_argn(3,version_triplet)
+m4_define(hb_version_triplet,m4_split(AC_PACKAGE_VERSION,[[.]]))
+m4_define(hb_version_major,m4_argn(1,hb_version_triplet))
+m4_define(hb_version_minor,m4_argn(2,hb_version_triplet))
+m4_define(hb_version_micro,m4_argn(3,hb_version_triplet))
+HB_VERSION_MAJOR=hb_version_major
+HB_VERSION_MINOR=hb_version_minor
+HB_VERSION_MICRO=hb_version_micro
 HB_VERSION=AC_PACKAGE_VERSION
-
 AC_SUBST(HB_VERSION_MAJOR)
 AC_SUBST(HB_VERSION_MINOR)
 AC_SUBST(HB_VERSION_MICRO)
 AC_SUBST(HB_VERSION)
 
+# Libtool version
+m4_define([hb_version_int],
+	  m4_eval(hb_version_major*10000 + hb_version_minor*100 + hb_version_micro))
+m4_if(m4_eval(hb_version_minor % 2), [1],
+      dnl for unstable releases
+      [m4_define([hb_libtool_revision], 0)],
+      dnl for stable releases
+      [m4_define([hb_libtool_revision], hb_version_micro)])
+m4_define([hb_libtool_age],
+	  m4_eval(hb_version_int - hb_libtool_revision))
+m4_define([hb_libtool_current],
+	  m4_eval(hb_version_major + hb_libtool_age))
+HB_LIBTOOL_VERSION_INFO=hb_libtool_current:hb_libtool_revision:hb_libtool_age
+AC_SUBST(HB_LIBTOOL_VERSION_INFO)
 
 # Functions and headers
 AC_CHECK_FUNCS(mprotect sysconf getpagesize mmap)
diff --git a/src/Makefile.am b/src/Makefile.am
index 1427340..df5c52f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -106,6 +106,7 @@ endif
 CXXLINK = $(LINK)
 libharfbuzz_la_SOURCES = $(HBSOURCES) $(HBHEADERS)
 libharfbuzz_la_CPPFLAGS = $(HBCFLAGS)
+libharfbuzz_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(HB_LIBTOOL_VERSION_INFO)
 libharfbuzz_la_LIBADD = $(HBLIBS)
 pkginclude_HEADERS = $(HBHEADERS)
 nodist_pkginclude_HEADERS = hb-version.h
commit 5b21eff8c4a00962d4315a47a65a143abe323299
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed May 25 14:49:35 2011 -0400

    Update README, etc

diff --git a/COPYING b/COPYING
index 7362ead..4bb77a0 100644
--- a/COPYING
+++ b/COPYING
@@ -8,6 +8,7 @@ Copyright © 2009  Martin Hosken and SIL International
 Copyright © 2007  Chris Wilson
 Copyright © 2004,2007,2008,2009,2010  Red Hat, Inc.
 Copyright © 1998-2004  David Turner and Werner Lemberg
+
 For full copyright notices consult the individual files in the package.
 
 
diff --git a/README b/README
index 06aad34..74e739d 100644
--- a/README
+++ b/README
@@ -1,9 +1,7 @@
 This is HarfBuzz, a text shaping library.
 
-Bug reports on these files should be sent to the HarfBuzz mailing list as
-listed on http://harfbuzz.org/
+For bug reports, mailing list, and other information please visit:
 
-For license information, see the file COPYING.
+  http://harfbuzz.org/
 
-Behdad Esfahbod
-18 November 2010
+For license information, see the file COPYING.
diff --git a/configure.ac b/configure.ac
index ba3290a..d596ce7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,7 @@ AC_INIT([harfbuzz],
         [0.5.0],
         [http://bugs.freedesktop.org/enter_bug.cgi?product=harfbuzz],
         [harfbuzz],
-        [http://freedesktop.org/wiki/Software/harfbuzz])
+        [http://harfbuzz.org/])
 
 AC_CONFIG_SRCDIR([harfbuzz.pc.in])
 AC_CONFIG_HEADERS([config.h])
commit 5bf56ea056b30fba8e07e82ec818c430cab8cafd
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed May 25 14:43:10 2011 -0400

    [TODO] Add item

diff --git a/TODO b/TODO
index d512b28..f770286 100644
--- a/TODO
+++ b/TODO
@@ -69,6 +69,8 @@ Tests to write:
 
 - ot-layout enumeration API (needs font)
 
+- Finish test-shape.c
+
 
 Optimizations:
 =============
diff --git a/test/test-shape.c b/test/test-shape.c
index c8017bf..99d2d4d 100644
--- a/test/test-shape.c
+++ b/test/test-shape.c
@@ -34,6 +34,8 @@
  * description.
  */
 
+/* TODO Make this test data-driven and add some real test data */
+
 
 static const char test_data[] = "test\0data";
 



More information about the HarfBuzz mailing list