[clutter/clutter-1.18] Fully rework the conformance test suite



commit 2a660fa298702111c192a7b51e2120799c9393de
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Thu Dec 12 14:36:16 2013 +0000

    Fully rework the conformance test suite
    
    The current conformance test suite is suboptimal in many ways.
    
    All tests are built into the same binary, which makes adding new tests,
    builting tests, and running groups of tests much more awkward than it
    needs to be. The first issue, especially, raises the bar of contribution
    in a significant way, while the other two take their toll on the
    maintainer. All of these changes were introduced back when we had both
    Clutter and Cogl tests in tree, and because we were building the test
    suite for every single change; since then, Cogl moved out of tree with
    all its tests, and we build the conformance test suite only when running
    the `check` make target.
    
    This admittedly large-ish commit changes the way the conformance test
    suite works, taking advantage of the changes in the GTest API and test
    harness.
    
    First of all, all tests are now built separately, using their own test
    suite as defined by each separate file. All tests run under the TAP
    harness provided by GTest and Automake, to gather a proper report using
    the Test Anything Protocol without using the `gtester` harness and the
    `gtester-report` script. We also use the Makefile rules provided by GLib
    to vastly simplify the build environment for the conformance test suite.
    
    On top of the changes for the build and harness, we also provide new API
    for creating and running test suites for Clutter. The API is public,
    because the test suite has to use it, but it's minimal and mostly
    provides convenience wrappers around GTest that make writing test units
    for Clutter easier.
    
    This commit disables all tests in the conformance test suite, as well as
    moving the data files outside of the tests/data directory; the next few
    commits will re-establish the conformance test suite separately so we
    can check that everything works in a reliable way.

 Makefile.am                                        |    6 +-
 build/autotools/Makefile.am                        |    4 +
 build/autotools/glib-tap.mk                        |  134 ++++
 build/autotools/glibtests.m4                       |   28 +
 build/autotools/tap-driver.sh                      |  652 ++++++++++++++++++++
 build/autotools/tap-test                           |    5 +
 clutter/Makefile.am                                |    2 +
 clutter/clutter-test-utils.c                       |  422 +++++++++++++
 clutter/clutter-test-utils.h                       |  164 +++++
 clutter/clutter.h                                  |    1 +
 clutter/clutter.symbols                            |    8 +
 configure.ac                                       |   24 +-
 examples/Makefile.am                               |    3 +-
 examples/bin-layout.c                              |    2 +-
 examples/image-content.c                           |    2 +-
 examples/pan-action.c                              |    2 +-
 {tests/data => examples}/redhand.png               |  Bin 8250 -> 8250 bytes
 tests/Makefile.am                                  |    4 +-
 tests/{data => }/clutter-1.0.suppressions          |    0
 tests/conform/ADDING_NEW_TESTS                     |   65 --
 tests/conform/Makefile.am                          |  345 ++---------
 tests/conform/run-tests.sh                         |   12 -
 .../{data => conform/scripts}/test-animator-1.json |    0
 .../{data => conform/scripts}/test-animator-2.json |    0
 .../{data => conform/scripts}/test-animator-3.json |    0
 .../scripts}/test-script-animation.json            |    0
 .../scripts}/test-script-child.json                |    0
 .../scripts}/test-script-implicit-alpha.json       |    0
 .../scripts}/test-script-interval.json             |    0
 .../scripts}/test-script-layout-property.json      |    0
 .../scripts}/test-script-margin.json               |    0
 .../scripts}/test-script-model.json                |    0
 .../scripts}/test-script-named-object.json         |    0
 .../scripts}/test-script-object-property.json      |    0
 .../scripts}/test-script-single.json               |    0
 .../scripts}/test-script-timeline-markers.json     |    0
 tests/{data => conform/scripts}/test-state-1.json  |    0
 tests/conform/test-conform-common.c                |  105 ----
 tests/conform/test-conform-common.h                |   52 --
 tests/conform/test-conform-main.c                  |  217 -------
 tests/conform/test-launcher.sh.in                  |   25 -
 tests/data/Makefile.am                             |   39 --
 tests/data/light0.png                              |  Bin 5674 -> 0 bytes
 tests/data/redhand_alpha.png                       |  Bin 4539 -> 0 bytes
 tests/interactive/Makefile.am                      |    9 +-
 tests/{data => interactive}/redhand.png            |  Bin 8250 -> 8250 bytes
 .../{data => interactive}/test-script-signals.json |    0
 tests/{data => interactive}/test-script.json       |    0
 tests/interactive/test-state-script.c              |    2 +-
 49 files changed, 1476 insertions(+), 858 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 1c37c56..8743964 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,11 +2,7 @@ include $(top_srcdir)/build/autotools/Makefile.am.silent
 
 NULL =
 
-SUBDIRS = clutter doc po build
-
-if BUILD_TESTS
-SUBDIRS += tests
-endif
+SUBDIRS = build clutter tests doc po
 
 if BUILD_EXAMPLES
 SUBDIRS += examples
diff --git a/build/autotools/Makefile.am b/build/autotools/Makefile.am
index 8446ea4..19dfd1c 100644
--- a/build/autotools/Makefile.am
+++ b/build/autotools/Makefile.am
@@ -11,4 +11,8 @@ EXTRA_DIST = \
        gtk-doc.m4              \
        as-compiler-flag.m4     \
        as-linguas.m4           \
+       glibtests.m4            \
+       glib-tap.mk             \
+       tap-driver.sh           \
+       tap-test                \
        $(NULL)
diff --git a/build/autotools/glib-tap.mk b/build/autotools/glib-tap.mk
new file mode 100644
index 0000000..7a634cd
--- /dev/null
+++ b/build/autotools/glib-tap.mk
@@ -0,0 +1,134 @@
+# GLIB - Library of useful C routines
+
+TESTS_ENVIRONMENT= \
+       G_TEST_SRCDIR="$(abs_srcdir)"           \
+       G_TEST_BUILDDIR="$(abs_builddir)"       \
+       G_DEBUG=gc-friendly                     \
+       MALLOC_CHECK_=2                         \
+       MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256))
+LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/build/autotools/tap-driver.sh
+LOG_COMPILER = $(top_srcdir)/build/autotools/tap-test
+
+NULL =
+
+# initialize variables for unconditional += appending
+BUILT_SOURCES =
+BUILT_EXTRA_DIST =
+CLEANFILES = *.log *.trs
+DISTCLEANFILES =
+MAINTAINERCLEANFILES =
+EXTRA_DIST =
+TESTS =
+
+installed_test_LTLIBRARIES =
+installed_test_PROGRAMS =
+installed_test_SCRIPTS =
+nobase_installed_test_DATA =
+
+noinst_LTLIBRARIES =
+noinst_PROGRAMS =
+noinst_SCRIPTS =
+noinst_DATA =
+
+check_LTLIBRARIES =
+check_PROGRAMS =
+check_SCRIPTS =
+check_DATA =
+
+# We support a fairly large range of possible variables.  It is expected that all types of files in a test 
suite
+# will belong in exactly one of the following variables.
+#
+# First, we support the usual automake suffixes, but in lowercase, with the customary meaning:
+#
+#   test_programs, test_scripts, test_data, test_ltlibraries
+#
+# The above are used to list files that are involved in both uninstalled and installed testing.  The
+# test_programs and test_scripts are taken to be actual testcases and will be run as part of the test suite.
+# Note that _data is always used with the nobase_ automake variable name to ensure that installed test data 
is
+# installed in the same way as it appears in the package layout.
+#
+# In order to mark a particular file as being only for one type of testing, use 'installed' or 'uninstalled',
+# like so:
+#
+#   installed_test_programs, uninstalled_test_programs
+#   installed_test_scripts, uninstalled_test_scripts
+#   installed_test_data, uninstalled_test_data
+#   installed_test_ltlibraries, uninstalled_test_ltlibraries
+#
+# Additionally, we support 'extra' infixes for programs and scripts.  This is used for support 
programs/scripts
+# that should not themselves be run as testcases (but exist to be used from other testcases):
+#
+#   test_extra_programs, installed_test_extra_programs, uninstalled_test_extra_programs
+#   test_extra_scripts, installed_test_extra_scripts, uninstalled_test_extra_scripts
+#
+# Additionally, for _scripts and _data, we support the customary dist_ prefix so that the named script or 
data
+# file automatically end up in the tarball.
+#
+#   dist_test_scripts, dist_test_data, dist_test_extra_scripts
+#   dist_installed_test_scripts, dist_installed_test_data, dist_installed_test_extra_scripts
+#   dist_uninstalled_test_scripts, dist_uninstalled_test_data, dist_uninstalled_test_extra_scripts
+#
+# Note that no file is automatically disted unless it appears in one of the dist_ variables.  This follows 
the
+# standard automake convention of not disting programs scripts or data by default.
+#
+# test_programs, test_scripts, uninstalled_test_programs and uninstalled_test_scripts (as well as their 
disted
+# variants) will be run as part of the in-tree 'make check'.  These are all assumed to be runnable under
+# gtester.  That's a bit strange for scripts, but it's possible.
+
+TESTS += $(test_programs) $(test_scripts) $(uninstalled_test_programs) $(uninstalled_test_scripts) \
+         $(dist_test_scripts) $(dist_uninstalled_test_scripts)
+
+# Note: build even the installed-only targets during 'make check' to ensure that they still work.
+# We need to do a bit of trickery here and manage disting via EXTRA_DIST instead of using dist_ prefixes to
+# prevent automake from mistreating gmake functions like $(wildcard ...) and $(addprefix ...) as if they were
+# filenames, including removing duplicate instances of the opening part before the space, eg. '$(addprefix'.
+all_test_programs     = $(test_programs) $(uninstalled_test_programs) $(installed_test_programs) \
+                        $(test_extra_programs) $(uninstalled_test_extra_programs) 
$(installed_test_extra_programs)
+all_test_scripts      = $(test_scripts) $(uninstalled_test_scripts) $(installed_test_scripts) \
+                        $(test_extra_scripts) $(uninstalled_test_extra_scripts) 
$(installed_test_extra_scripts)
+all_dist_test_scripts = $(dist_test_scripts) $(dist_uninstalled_test_scripts) $(dist_installed_test_scripts) 
\
+                        $(dist_test_extra_scripts) $(dist_uninstalled_test_extra_scripts) 
$(dist_installed_test_extra_scripts)
+all_test_scripts     += $(all_dist_test_scripts)
+EXTRA_DIST           += $(all_dist_test_scripts)
+all_test_data         = $(test_data) $(uninstalled_test_data) $(installed_test_data)
+all_dist_test_data    = $(dist_test_data) $(dist_uninstalled_test_data) $(dist_installed_test_data)
+all_test_data        += $(all_dist_test_data)
+EXTRA_DIST           += $(all_dist_test_data)
+all_test_ltlibs       = $(test_ltlibraries) $(uninstalled_test_ltlibraries) $(installed_test_ltlibraries)
+
+if ENABLE_ALWAYS_BUILD_TESTS
+noinst_LTLIBRARIES += $(all_test_ltlibs)
+noinst_PROGRAMS += $(all_test_programs)
+noinst_SCRIPTS += $(all_test_scripts)
+noinst_DATA += $(all_test_data)
+else
+check_LTLIBRARIES += $(all_test_ltlibs)
+check_PROGRAMS += $(all_test_programs)
+check_SCRIPTS += $(all_test_scripts)
+check_DATA += $(all_test_data)
+endif
+
+if ENABLE_INSTALLED_TESTS
+installed_test_PROGRAMS += $(test_programs) $(installed_test_programs) \
+                          $(test_extra_programs) $(installed_test_extra_programs)
+installed_test_SCRIPTS += $(test_scripts) $(installed_test_scripts) \
+                          $(test_extra_scripts) $(test_installed_extra_scripts)
+installed_test_SCRIPTS += $(dist_test_scripts) $(dist_test_extra_scripts) \
+                          $(dist_installed_test_scripts) $(dist_installed_test_extra_scripts)
+nobase_installed_test_DATA += $(test_data) $(installed_test_data)
+nobase_installed_test_DATA += $(dist_test_data) $(dist_installed_test_data)
+installed_test_LTLIBRARIES += $(test_ltlibraries) $(installed_test_ltlibraries)
+installed_testcases = $(test_programs) $(installed_test_programs) \
+                      $(test_scripts) $(installed_test_scripts) \
+                      $(dist_test_scripts) $(dist_installed_test_scripts)
+
+installed_test_meta_DATA = $(installed_testcases:=.test)
+
+%.test: %$(EXEEXT) Makefile
+       $(AM_V_GEN) (echo '[Test]' > $  tmp; \
+       echo 'Type=session' >> $  tmp; \
+       echo 'Exec=$(installed_testdir)/$<' >> $  tmp; \
+       mv $  tmp $@)
+
+CLEANFILES += $(installed_test_meta_DATA)
+endif
diff --git a/build/autotools/glibtests.m4 b/build/autotools/glibtests.m4
new file mode 100644
index 0000000..7d5920a
--- /dev/null
+++ b/build/autotools/glibtests.m4
@@ -0,0 +1,28 @@
+dnl GLIB_TESTS
+dnl
+
+AC_DEFUN([GLIB_TESTS],
+[
+  AC_ARG_ENABLE(installed-tests,
+                AS_HELP_STRING([--enable-installed-tests],
+                               [Enable installation of some test cases]),
+                [case ${enableval} in
+                  yes) ENABLE_INSTALLED_TESTS="1"  ;;
+                  no)  ENABLE_INSTALLED_TESTS="" ;;
+                  *) AC_MSG_ERROR([bad value ${enableval} for --enable-installed-tests]) ;;
+                 esac])
+  AM_CONDITIONAL([ENABLE_INSTALLED_TESTS], test "$ENABLE_INSTALLED_TESTS" = "1")
+  AC_ARG_ENABLE(always-build-tests,
+                AS_HELP_STRING([--enable-always-build-tests],
+                               [Enable always building tests during 'make all']),
+                [case ${enableval} in
+                  yes) ENABLE_ALWAYS_BUILD_TESTS="1"  ;;
+                  no)  ENABLE_ALWAYS_BUILD_TESTS="" ;;
+                  *) AC_MSG_ERROR([bad value ${enableval} for --enable-always-build-tests]) ;;
+                 esac])
+  AM_CONDITIONAL([ENABLE_ALWAYS_BUILD_TESTS], test "$ENABLE_ALWAYS_BUILD_TESTS" = "1")
+  if test "$ENABLE_INSTALLED_TESTS" = "1"; then
+    AC_SUBST(installed_test_metadir, [${datadir}/installed-tests/]AC_PACKAGE_NAME)
+    AC_SUBST(installed_testdir, [${libexecdir}/installed-tests/]AC_PACKAGE_NAME)
+  fi
+])
diff --git a/build/autotools/tap-driver.sh b/build/autotools/tap-driver.sh
new file mode 100755
index 0000000..19aa531
--- /dev/null
+++ b/build/autotools/tap-driver.sh
@@ -0,0 +1,652 @@
+#! /bin/sh
+# Copyright (C) 2011-2013 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake gnu org> or send patches to
+# <automake-patches gnu org>.
+
+scriptversion=2011-12-27.17; # UTC
+
+# Make unconditional expansion of undefined variables an error.  This
+# helps a lot in preventing typo-related bugs.
+set -u
+
+me=tap-driver.sh
+
+fatal ()
+{
+  echo "$me: fatal: $*" >&2
+  exit 1
+}
+
+usage_error ()
+{
+  echo "$me: $*" >&2
+  print_usage >&2
+  exit 2
+}
+
+print_usage ()
+{
+  cat <<END
+Usage:
+  tap-driver.sh --test-name=NAME --log-file=PATH --trs-file=PATH
+                [--expect-failure={yes|no}] [--color-tests={yes|no}]
+                [--enable-hard-errors={yes|no}] [--ignore-exit]
+                [--diagnostic-string=STRING] [--merge|--no-merge]
+                [--comments|--no-comments] [--] TEST-COMMAND
+The \`--test-name', \`--log-file' and \`--trs-file' options are mandatory.
+END
+}
+
+# TODO: better error handling in option parsing (in particular, ensure
+# TODO: $log_file, $trs_file and $test_name are defined).
+test_name= # Used for reporting.
+log_file=  # Where to save the result and output of the test script.
+trs_file=  # Where to save the metadata of the test run.
+expect_failure=0
+color_tests=0
+merge=0
+ignore_exit=0
+comments=0
+diag_string='#'
+while test $# -gt 0; do
+  case $1 in
+  --help) print_usage; exit $?;;
+  --version) echo "$me $scriptversion"; exit $?;;
+  --test-name) test_name=$2; shift;;
+  --log-file) log_file=$2; shift;;
+  --trs-file) trs_file=$2; shift;;
+  --color-tests) color_tests=$2; shift;;
+  --expect-failure) expect_failure=$2; shift;;
+  --enable-hard-errors) shift;; # No-op.
+  --merge) merge=1;;
+  --no-merge) merge=0;;
+  --ignore-exit) ignore_exit=1;;
+  --comments) comments=1;;
+  --no-comments) comments=0;;
+  --diagnostic-string) diag_string=$2; shift;;
+  --) shift; break;;
+  -*) usage_error "invalid option: '$1'";;
+  esac
+  shift
+done
+
+test $# -gt 0 || usage_error "missing test command"
+
+case $expect_failure in
+  yes) expect_failure=1;;
+    *) expect_failure=0;;
+esac
+
+if test $color_tests = yes; then
+  init_colors='
+    color_map["red"]="" # Red.
+    color_map["grn"]="" # Green.
+    color_map["lgn"]="" # Light green.
+    color_map["blu"]="" # Blue.
+    color_map["mgn"]="" # Magenta.
+    color_map["std"]=""     # No color.
+    color_for_result["ERROR"] = "mgn"
+    color_for_result["PASS"]  = "grn"
+    color_for_result["XPASS"] = "red"
+    color_for_result["FAIL"]  = "red"
+    color_for_result["XFAIL"] = "lgn"
+    color_for_result["SKIP"]  = "blu"'
+else
+  init_colors=''
+fi
+
+# :; is there to work around a bug in bash 3.2 (and earlier) which
+# does not always set '$?' properly on redirection failure.
+# See the Autoconf manual for more details.
+:;{
+  (
+    # Ignore common signals (in this subshell only!), to avoid potential
+    # problems with Korn shells.  Some Korn shells are known to propagate
+    # to themselves signals that have killed a child process they were
+    # waiting for; this is done at least for SIGINT (and usually only for
+    # it, in truth).  Without the `trap' below, such a behaviour could
+    # cause a premature exit in the current subshell, e.g., in case the
+    # test command it runs gets terminated by a SIGINT.  Thus, the awk
+    # script we are piping into would never seen the exit status it
+    # expects on its last input line (which is displayed below by the
+    # last `echo $?' statement), and would thus die reporting an internal
+    # error.
+    # For more information, see the Autoconf manual and the threads:
+    # <http://lists.gnu.org/archive/html/bug-autoconf/2011-09/msg00004.html>
+    # <http://mail.opensolaris.org/pipermail/ksh93-integration-discuss/2009-February/004121.html>
+    trap : 1 3 2 13 15
+    if test $merge -gt 0; then
+      exec 2>&1
+    else
+      exec 2>&3
+    fi
+    "$@"
+    echo $?
+  ) | LC_ALL=C ${AM_TAP_AWK-awk} \
+        -v me="$me" \
+        -v test_script_name="$test_name" \
+        -v log_file="$log_file" \
+        -v trs_file="$trs_file" \
+        -v expect_failure="$expect_failure" \
+        -v merge="$merge" \
+        -v ignore_exit="$ignore_exit" \
+        -v comments="$comments" \
+        -v diag_string="$diag_string" \
+'
+# FIXME: the usages of "cat >&3" below could be optimized when using
+# FIXME: GNU awk, and/on on systems that supports /dev/fd/.
+
+# Implementation note: in what follows, `result_obj` will be an
+# associative array that (partly) simulates a TAP result object
+# from the `TAP::Parser` perl module.
+
+## ----------- ##
+##  FUNCTIONS  ##
+## ----------- ##
+
+function fatal(msg)
+{
+  print me ": " msg | "cat >&2"
+  exit 1
+}
+
+function abort(where)
+{
+  fatal("internal error " where)
+}
+
+# Convert a boolean to a "yes"/"no" string.
+function yn(bool)
+{
+  return bool ? "yes" : "no";
+}
+
+function add_test_result(result)
+{
+  if (!test_results_index)
+    test_results_index = 0
+  test_results_list[test_results_index] = result
+  test_results_index += 1
+  test_results_seen[result] = 1;
+}
+
+# Whether the test script should be re-run by "make recheck".
+function must_recheck()
+{
+  for (k in test_results_seen)
+    if (k != "XFAIL" && k != "PASS" && k != "SKIP")
+      return 1
+  return 0
+}
+
+# Whether the content of the log file associated to this test should
+# be copied into the "global" test-suite.log.
+function copy_in_global_log()
+{
+  for (k in test_results_seen)
+    if (k != "PASS")
+      return 1
+  return 0
+}
+
+# FIXME: this can certainly be improved ...
+function get_global_test_result()
+{
+    if ("ERROR" in test_results_seen)
+      return "ERROR"
+    if ("FAIL" in test_results_seen || "XPASS" in test_results_seen)
+      return "FAIL"
+    all_skipped = 1
+    for (k in test_results_seen)
+      if (k != "SKIP")
+        all_skipped = 0
+    if (all_skipped)
+      return "SKIP"
+    return "PASS";
+}
+
+function stringify_result_obj(result_obj)
+{
+  if (result_obj["is_unplanned"] || result_obj["number"] != testno)
+    return "ERROR"
+
+  if (plan_seen == LATE_PLAN)
+    return "ERROR"
+
+  if (result_obj["directive"] == "TODO")
+    return result_obj["is_ok"] ? "XPASS" : "XFAIL"
+
+  if (result_obj["directive"] == "SKIP")
+    return result_obj["is_ok"] ? "SKIP" : COOKED_FAIL;
+
+  if (length(result_obj["directive"]))
+      abort("in function stringify_result_obj()")
+
+  return result_obj["is_ok"] ? COOKED_PASS : COOKED_FAIL
+}
+
+function decorate_result(result)
+{
+  color_name = color_for_result[result]
+  if (color_name)
+    return color_map[color_name] "" result "" color_map["std"]
+  # If we are not using colorized output, or if we do not know how
+  # to colorize the given result, we should return it unchanged.
+  return result
+}
+
+function report(result, details)
+{
+  if (result ~ /^(X?(PASS|FAIL)|SKIP|ERROR)/)
+    {
+      msg = ": " test_script_name
+      add_test_result(result)
+    }
+  else if (result == "#")
+    {
+      msg = " " test_script_name ":"
+    }
+  else
+    {
+      abort("in function report()")
+    }
+  if (length(details))
+    msg = msg " " details
+  # Output on console might be colorized.
+  print decorate_result(result) msg
+  # Log the result in the log file too, to help debugging (this is
+  # especially true when said result is a TAP error or "Bail out!").
+  print result msg | "cat >&3";
+}
+
+function testsuite_error(error_message)
+{
+  report("ERROR", "- " error_message)
+}
+
+function handle_tap_result()
+{
+  details = result_obj["number"];
+  if (length(result_obj["description"]))
+    details = details " " result_obj["description"]
+
+  if (plan_seen == LATE_PLAN)
+    {
+      details = details " # AFTER LATE PLAN";
+    }
+  else if (result_obj["is_unplanned"])
+    {
+       details = details " # UNPLANNED";
+    }
+  else if (result_obj["number"] != testno)
+    {
+       details = sprintf("%s # OUT-OF-ORDER (expecting %d)",
+                         details, testno);
+    }
+  else if (result_obj["directive"])
+    {
+      details = details " # " result_obj["directive"];
+      if (length(result_obj["explanation"]))
+        details = details " " result_obj["explanation"]
+    }
+
+  report(stringify_result_obj(result_obj), details)
+}
+
+# `skip_reason` should be empty whenever planned > 0.
+function handle_tap_plan(planned, skip_reason)
+{
+  planned += 0 # Avoid getting confused if, say, `planned` is "00"
+  if (length(skip_reason) && planned > 0)
+    abort("in function handle_tap_plan()")
+  if (plan_seen)
+    {
+      # Error, only one plan per stream is acceptable.
+      testsuite_error("multiple test plans")
+      return;
+    }
+  planned_tests = planned
+  # The TAP plan can come before or after *all* the TAP results; we speak
+  # respectively of an "early" or a "late" plan.  If we see the plan line
+  # after at least one TAP result has been seen, assume we have a late
+  # plan; in this case, any further test result seen after the plan will
+  # be flagged as an error.
+  plan_seen = (testno >= 1 ? LATE_PLAN : EARLY_PLAN)
+  # If testno > 0, we have an error ("too many tests run") that will be
+  # automatically dealt with later, so do not worry about it here.  If
+  # $plan_seen is true, we have an error due to a repeated plan, and that
+  # has already been dealt with above.  Otherwise, we have a valid "plan
+  # with SKIP" specification, and should report it as a particular kind
+  # of SKIP result.
+  if (planned == 0 && testno == 0)
+    {
+      if (length(skip_reason))
+        skip_reason = "- "  skip_reason;
+      report("SKIP", skip_reason);
+    }
+}
+
+function extract_tap_comment(line)
+{
+  if (index(line, diag_string) == 1)
+    {
+      # Strip leading `diag_string` from `line`.
+      line = substr(line, length(diag_string) + 1)
+      # And strip any leading and trailing whitespace left.
+      sub("^[ \t]*", "", line)
+      sub("[ \t]*$", "", line)
+      # Return what is left (if any).
+      return line;
+    }
+  return "";
+}
+
+# When this function is called, we know that line is a TAP result line,
+# so that it matches the (perl) RE "^(not )?ok\b".
+function setup_result_obj(line)
+{
+  # Get the result, and remove it from the line.
+  result_obj["is_ok"] = (substr(line, 1, 2) == "ok" ? 1 : 0)
+  sub("^(not )?ok[ \t]*", "", line)
+
+  # If the result has an explicit number, get it and strip it; otherwise,
+  # automatically assing the next progresive number to it.
+  if (line ~ /^[0-9]+$/ || line ~ /^[0-9]+[^a-zA-Z0-9_]/)
+    {
+      match(line, "^[0-9]+")
+      # The final `+ 0` is to normalize numbers with leading zeros.
+      result_obj["number"] = substr(line, 1, RLENGTH) + 0
+      line = substr(line, RLENGTH + 1)
+    }
+  else
+    {
+      result_obj["number"] = testno
+    }
+
+  if (plan_seen == LATE_PLAN)
+    # No further test results are acceptable after a "late" TAP plan
+    # has been seen.
+    result_obj["is_unplanned"] = 1
+  else if (plan_seen && testno > planned_tests)
+    result_obj["is_unplanned"] = 1
+  else
+    result_obj["is_unplanned"] = 0
+
+  # Strip trailing and leading whitespace.
+  sub("^[ \t]*", "", line)
+  sub("[ \t]*$", "", line)
+
+  # This will have to be corrected if we have a "TODO"/"SKIP" directive.
+  result_obj["description"] = line
+  result_obj["directive"] = ""
+  result_obj["explanation"] = ""
+
+  if (index(line, "#") == 0)
+    return # No possible directive, nothing more to do.
+
+  # Directives are case-insensitive.
+  rx = "[ \t]*#[ \t]*([tT][oO][dD][oO]|[sS][kK][iI][pP])[ \t]*"
+
+  # See whether we have the directive, and if yes, where.
+  pos = match(line, rx "$")
+  if (!pos)
+    pos = match(line, rx "[^a-zA-Z0-9_]")
+
+  # If there was no TAP directive, we have nothing more to do.
+  if (!pos)
+    return
+
+  # Let`s now see if the TAP directive has been escaped.  For example:
+  #  escaped:     ok \# SKIP
+  #  not escaped: ok \\# SKIP
+  #  escaped:     ok \\\\\# SKIP
+  #  not escaped: ok \ # SKIP
+  if (substr(line, pos, 1) == "#")
+    {
+      bslash_count = 0
+      for (i = pos; i > 1 && substr(line, i - 1, 1) == "\\"; i--)
+        bslash_count += 1
+      if (bslash_count % 2)
+        return # Directive was escaped.
+    }
+
+  # Strip the directive and its explanation (if any) from the test
+  # description.
+  result_obj["description"] = substr(line, 1, pos - 1)
+  # Now remove the test description from the line, that has been dealt
+  # with already.
+  line = substr(line, pos)
+  # Strip the directive, and save its value (normalized to upper case).
+  sub("^[ \t]*#[ \t]*", "", line)
+  result_obj["directive"] = toupper(substr(line, 1, 4))
+  line = substr(line, 5)
+  # Now get the explanation for the directive (if any), with leading
+  # and trailing whitespace removed.
+  sub("^[ \t]*", "", line)
+  sub("[ \t]*$", "", line)
+  result_obj["explanation"] = line
+}
+
+function get_test_exit_message(status)
+{
+  if (status == 0)
+    return ""
+  if (status !~ /^[1-9][0-9]*$/)
+    abort("getting exit status")
+  if (status < 127)
+    exit_details = ""
+  else if (status == 127)
+    exit_details = " (command not found?)"
+  else if (status >= 128 && status <= 255)
+    exit_details = sprintf(" (terminated by signal %d?)", status - 128)
+  else if (status > 256 && status <= 384)
+    # We used to report an "abnormal termination" here, but some Korn
+    # shells, when a child process die due to signal number n, can leave
+    # in $? an exit status of 256+n instead of the more standard 128+n.
+    # Apparently, both behaviours are allowed by POSIX (2008), so be
+    # prepared to handle them both.  See also Austing Group report ID
+    # 0000051 <http://www.austingroupbugs.net/view.php?id=51>
+    exit_details = sprintf(" (terminated by signal %d?)", status - 256)
+  else
+    # Never seen in practice.
+    exit_details = " (abnormal termination)"
+  return sprintf("exited with status %d%s", status, exit_details)
+}
+
+function write_test_results()
+{
+  print ":global-test-result: " get_global_test_result() > trs_file
+  print ":recheck: "  yn(must_recheck()) > trs_file
+  print ":copy-in-global-log: " yn(copy_in_global_log()) > trs_file
+  for (i = 0; i < test_results_index; i += 1)
+    print ":test-result: " test_results_list[i] > trs_file
+  close(trs_file);
+}
+
+BEGIN {
+
+## ------- ##
+##  SETUP  ##
+## ------- ##
+
+'"$init_colors"'
+
+# Properly initialized once the TAP plan is seen.
+planned_tests = 0
+
+COOKED_PASS = expect_failure ? "XPASS": "PASS";
+COOKED_FAIL = expect_failure ? "XFAIL": "FAIL";
+
+# Enumeration-like constants to remember which kind of plan (if any)
+# has been seen.  It is important that NO_PLAN evaluates "false" as
+# a boolean.
+NO_PLAN = 0
+EARLY_PLAN = 1
+LATE_PLAN = 2
+
+testno = 0     # Number of test results seen so far.
+bailed_out = 0 # Whether a "Bail out!" directive has been seen.
+
+# Whether the TAP plan has been seen or not, and if yes, which kind
+# it is ("early" is seen before any test result, "late" otherwise).
+plan_seen = NO_PLAN
+
+## --------- ##
+##  PARSING  ##
+## --------- ##
+
+is_first_read = 1
+
+while (1)
+  {
+    # Involutions required so that we are able to read the exit status
+    # from the last input line.
+    st = getline
+    if (st < 0) # I/O error.
+      fatal("I/O error while reading from input stream")
+    else if (st == 0) # End-of-input
+      {
+        if (is_first_read)
+          abort("in input loop: only one input line")
+        break
+      }
+    if (is_first_read)
+      {
+        is_first_read = 0
+        nextline = $0
+        continue
+      }
+    else
+      {
+        curline = nextline
+        nextline = $0
+        $0 = curline
+      }
+    # Copy any input line verbatim into the log file.
+    print | "cat >&3"
+    # Parsing of TAP input should stop after a "Bail out!" directive.
+    if (bailed_out)
+      continue
+
+    # TAP test result.
+    if ($0 ~ /^(not )?ok$/ || $0 ~ /^(not )?ok[^a-zA-Z0-9_]/)
+      {
+        testno += 1
+        setup_result_obj($0)
+        handle_tap_result()
+      }
+    # TAP plan (normal or "SKIP" without explanation).
+    else if ($0 ~ /^1\.\.[0-9]+[ \t]*$/)
+      {
+        # The next two lines will put the number of planned tests in $0.
+        sub("^1\\.\\.", "")
+        sub("[^0-9]*$", "")
+        handle_tap_plan($0, "")
+        continue
+      }
+    # TAP "SKIP" plan, with an explanation.
+    else if ($0 ~ /^1\.\.0+[ \t]*#/)
+      {
+        # The next lines will put the skip explanation in $0, stripping
+        # any leading and trailing whitespace.  This is a little more
+        # tricky in truth, since we want to also strip a potential leading
+        # "SKIP" string from the message.
+        sub("^[^#]*#[ \t]*(SKIP[: \t][ \t]*)?", "")
+        sub("[ \t]*$", "");
+        handle_tap_plan(0, $0)
+      }
+    # "Bail out!" magic.
+    # Older versions of prove and TAP::Harness (e.g., 3.17) did not
+    # recognize a "Bail out!" directive when preceded by leading
+    # whitespace, but more modern versions (e.g., 3.23) do.  So we
+    # emulate the latter, "more modern" behaviour.
+    else if ($0 ~ /^[ \t]*Bail out!/)
+      {
+        bailed_out = 1
+        # Get the bailout message (if any), with leading and trailing
+        # whitespace stripped.  The message remains stored in `$0`.
+        sub("^[ \t]*Bail out![ \t]*", "");
+        sub("[ \t]*$", "");
+        # Format the error message for the
+        bailout_message = "Bail out!"
+        if (length($0))
+          bailout_message = bailout_message " " $0
+        testsuite_error(bailout_message)
+      }
+    # Maybe we have too look for dianogtic comments too.
+    else if (comments != 0)
+      {
+        comment = extract_tap_comment($0);
+        if (length(comment))
+          report("#", comment);
+      }
+  }
+
+## -------- ##
+##  FINISH  ##
+## -------- ##
+
+# A "Bail out!" directive should cause us to ignore any following TAP
+# error, as well as a non-zero exit status from the TAP producer.
+if (!bailed_out)
+  {
+    if (!plan_seen)
+      {
+        testsuite_error("missing test plan")
+      }
+    else if (planned_tests != testno)
+      {
+        bad_amount = testno > planned_tests ? "many" : "few"
+        testsuite_error(sprintf("too %s tests run (expected %d, got %d)",
+                                bad_amount, planned_tests, testno))
+      }
+    if (!ignore_exit)
+      {
+        # Fetch exit status from the last line.
+        exit_message = get_test_exit_message(nextline)
+        if (exit_message)
+          testsuite_error(exit_message)
+      }
+  }
+
+write_test_results()
+
+exit 0
+
+} # End of "BEGIN" block.
+'
+
+# TODO: document that we consume the file descriptor 3 :-(
+} 3>"$log_file"
+
+test $? -eq 0 || fatal "I/O or internal error"
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/build/autotools/tap-test b/build/autotools/tap-test
new file mode 100755
index 0000000..481e333
--- /dev/null
+++ b/build/autotools/tap-test
@@ -0,0 +1,5 @@
+#! /bin/sh
+
+# run a GTest in tap mode. The test binary is passed as $1
+
+$1 -k --tap
diff --git a/clutter/Makefile.am b/clutter/Makefile.am
index 21ea818..09f5fc6 100644
--- a/clutter/Makefile.am
+++ b/clutter/Makefile.am
@@ -116,6 +116,7 @@ source_h =                                  \
        $(srcdir)/clutter-stage.h               \
        $(srcdir)/clutter-stage-manager.h       \
        $(srcdir)/clutter-tap-action.h          \
+       $(srcdir)/clutter-test-utils.h          \
        $(srcdir)/clutter-texture.h             \
        $(srcdir)/clutter-text.h                \
        $(srcdir)/clutter-text-buffer.h         \
@@ -199,6 +200,7 @@ source_c = \
        $(srcdir)/clutter-stage-manager.c       \
        $(srcdir)/clutter-stage-window.c        \
        $(srcdir)/clutter-tap-action.c          \
+       $(srcdir)/clutter-test-utils.c          \
        $(srcdir)/clutter-text.c                \
        $(srcdir)/clutter-text-buffer.c         \
        $(srcdir)/clutter-transition-group.c    \
diff --git a/clutter/clutter-test-utils.c b/clutter/clutter-test-utils.c
new file mode 100644
index 0000000..65df093
--- /dev/null
+++ b/clutter/clutter-test-utils.c
@@ -0,0 +1,422 @@
+#include "config.h"
+
+#include "clutter-test-utils.h"
+
+#include <stdlib.h>
+#include <glib-object.h>
+
+#include "clutter-actor.h"
+#include "clutter-color.h"
+#include "clutter-event.h"
+#include "clutter-keysyms.h"
+#include "clutter-main.h"
+#include "clutter-stage.h"
+
+typedef struct {
+  ClutterActor *stage;
+} ClutterTestEnvironment;
+
+static ClutterTestEnvironment *environ = NULL;
+
+/**
+ * clutter_test_init:
+ * @argc:
+ * @argv:
+ *
+ * Initializes the Clutter test environment.
+ *
+ * Since: 1.18
+ */
+void
+clutter_test_init (int    *argc,
+                   char ***argv)
+{
+  if (G_UNLIKELY (environ != NULL))
+    g_error ("Attempting to initialize the test suite more than once, "
+             "aborting...\n");
+
+#ifdef CLUTTER_WINDOWING_X11
+  /* on X11 backends we need the DISPLAY environment set.
+   *
+   * check_windowing_backend() will pre-initialize the Clutter
+   * backend object.
+   */
+  if (clutter_check_windowing_backend (CLUTTER_WINDOWING_X11))
+    {
+      const char *display = g_getenv ("DISPLAY");
+
+      if (display == NULL || *display == '\0')
+        {
+          g_print ("No DISPLAY environment variable found, but we require a "
+                   "DISPLAY set in order to run the conformance test suite.");
+          exit (0);
+        }
+    }
+#endif
+
+  /* by explicitly setting CLUTTER_VBLANK to "none" we disable the
+   * synchronisation, and run the master clock using a 60 fps timer
+   * instead.
+   */
+  g_setenv ("CLUTTER_VBLANK", "none", FALSE);
+
+  g_test_init (argc, argv, NULL);
+  g_test_bug_base ("https://bugzilla.gnome.org/show_bug.cgi?id=%s";);
+
+  /* perform the actual initialization */
+  g_assert (clutter_init (NULL, NULL) == CLUTTER_INIT_SUCCESS);
+
+  /* our global state, accessible from each test unit */
+  environ = g_new0 (ClutterTestEnvironment, 1);
+}
+
+/**
+ * clutter_test_get_stage:
+ *
+ * Retrieves the #ClutterStage used for testing.
+ *
+ * Return value: (transfer none): the stage used for testing
+ *
+ * Since: 1.18
+ */
+ClutterActor *
+clutter_test_get_stage (void)
+{
+  g_assert (environ != NULL);
+
+  if (environ->stage == NULL)
+    {
+      /* create a stage, and ensure that it goes away at the end */
+      environ->stage = clutter_stage_new ();
+      clutter_actor_set_name (environ->stage, "Test Stage");
+      g_object_add_weak_pointer (G_OBJECT (environ->stage),
+                                 (gpointer *) &environ->stage);
+    }
+
+  return environ->stage;
+}
+
+typedef struct {
+  gpointer test_func;
+  gpointer test_data;
+  GDestroyNotify test_notify;
+} ClutterTestData;
+
+static void
+clutter_test_func_wrapper (gconstpointer data_)
+{
+  const ClutterTestData *data = data_;
+
+  /* ensure that the previous test state has been cleaned up */
+  g_assert_null (environ->stage);
+
+  if (data->test_data != NULL)
+    {
+      GTestDataFunc test_func = data->test_func;
+
+      test_func (data->test_data);
+    }
+  else
+    {
+      GTestFunc test_func = data->test_func;
+
+      test_func ();
+    }
+
+  if (data->test_notify != NULL)
+    data->test_notify (data->test_data);
+
+  if (environ->stage != NULL)
+    {
+      clutter_actor_destroy (environ->stage);
+      g_assert_null (environ->stage);
+    }
+}
+
+/**
+ * clutter_test_add: (skip)
+ * @test_path:
+ * @test_func:
+ *
+ * Adds a test unit to the Clutter test environment.
+ *
+ * See also: g_test_add()
+ *
+ * Since: 1.18
+ */
+void
+clutter_test_add (const char *test_path,
+                  GTestFunc   test_func)
+{
+  clutter_test_add_data_full (test_path, (GTestDataFunc) test_func, NULL, NULL);
+}
+
+/**
+ * clutter_test_add_data: (skip)
+ * @test_path:
+ * @test_func:
+ * @test_data:
+ *
+ * Adds a test unit to the Clutter test environment.
+ *
+ * See also: g_test_add_data_func()
+ *
+ * Since: 1.18
+ */
+void
+clutter_test_add_data (const char    *test_path,
+                       GTestDataFunc  test_func,
+                       gpointer       test_data)
+{
+  clutter_test_add_data_full (test_path, test_func, test_data, NULL);
+}
+
+/**
+ * clutter_test_add_data_full:
+ * @test_path:
+ * @test_func: (scope notified)
+ * @test_data:
+ * @test_notify:
+ *
+ * Adds a test unit to the Clutter test environment.
+ *
+ * See also: g_test_add_data_func_full()
+ *
+ * Since: 1.18
+ */
+void
+clutter_test_add_data_full (const char     *test_path,
+                            GTestDataFunc   test_func,
+                            gpointer        test_data,
+                            GDestroyNotify  test_notify)
+{
+  ClutterTestData *data;
+
+  g_return_if_fail (test_path != NULL);
+  g_return_if_fail (test_func != NULL);
+
+  g_assert (environ != NULL);
+
+  data = g_new (ClutterTestData, 1);
+  data->test_func = test_func;
+  data->test_data = test_data;
+  data->test_notify = test_notify;
+
+  g_test_add_data_func_full (test_path, data,
+                             clutter_test_func_wrapper,
+                             g_free);
+}
+
+/**
+ * clutter_test_run:
+ *
+ * Runs the test suite using the units added by calling
+ * clutter_test_add().
+ *
+ * The typical test suite is composed of a list of functions
+ * called by clutter_test_run(), for instance:
+ *
+ * |[
+ * static void unit_foo (void) { ... }
+ *
+ * static void unit_bar (void) { ... }
+ *
+ * static void unit_baz (void) { ... }
+ *
+ * int
+ * main (int argc, char *argv[])
+ * {
+ *   clutter_test_init (&amp;argc, &amp;argv);
+ *
+ *   clutter_test_add ("/unit/foo", unit_foo);
+ *   clutter_test_add ("/unit/bar", unit_bar);
+ *   clutter_test_add ("/unit/baz", unit_baz);
+ *
+ *   return clutter_test_run ();
+ * }
+ * ]|
+ *
+ * Return value: the exit code for the test suite
+ *
+ * Since: 1.18
+ */
+int
+clutter_test_run (void)
+{
+  int res;
+
+  g_assert (environ != NULL);
+  
+  res = g_test_run ();
+
+  g_free (environ);
+
+  return res;
+}
+
+typedef struct {
+  ClutterActor *stage;
+
+  ClutterPoint point;
+
+  gpointer result;
+
+  guint check_actor : 1;
+  guint check_color : 1;
+
+  guint was_painted : 1;
+} ValidateData;
+
+static gboolean
+validate_stage (gpointer data_)
+{
+  ValidateData *data = data_;
+
+  if (data->check_actor)
+    {
+      data->result =
+        clutter_stage_get_actor_at_pos (CLUTTER_STAGE (data->stage),
+                                        CLUTTER_PICK_ALL,
+                                        data->point.x,
+                                        data->point.y);
+    }
+
+  if (data->check_color)
+    {
+      data->result =
+        clutter_stage_read_pixels (CLUTTER_STAGE (data->stage),
+                                   data->point.x,
+                                   data->point.y,
+                                   1, 1);
+    }
+
+  if (!g_test_verbose ())
+    {
+      clutter_actor_hide (data->stage);
+      data->was_painted = TRUE;
+    }
+
+  return G_SOURCE_REMOVE;
+}
+
+static gboolean
+on_key_press_event (ClutterActor *stage,
+                    ClutterEvent *event,
+                    gpointer      data_)
+{
+  ValidateData *data = data_;
+
+  if (data->stage == stage &&
+      clutter_event_get_key_symbol (event) == CLUTTER_KEY_Escape)
+    {
+      clutter_actor_hide (stage);
+
+      data->was_painted = TRUE;
+    }
+
+  return CLUTTER_EVENT_PROPAGATE;
+}
+
+gboolean
+clutter_test_check_actor_at_point (ClutterActor        *stage,
+                                   const ClutterPoint  *point,
+                                   ClutterActor        *actor,
+                                   ClutterActor       **result)
+{
+  ValidateData *data;
+  guint press_id = 0;
+
+  g_return_val_if_fail (CLUTTER_IS_STAGE (stage), FALSE);
+  g_return_val_if_fail (point != NULL, FALSE);
+  g_return_val_if_fail (CLUTTER_IS_ACTOR (stage), FALSE);
+  g_return_val_if_fail (result != NULL, FALSE);
+
+  data = g_new0 (ValidateData, 1);
+  data->stage = stage;
+  data->point = *point;
+  data->check_actor = TRUE;
+
+  if (g_test_verbose ())
+    {
+      g_printerr ("Press ESC to close the stage and resume the test\n");
+      press_id = g_signal_connect (stage, "key-press-event",
+                                   G_CALLBACK (on_key_press_event),
+                                   data);
+    }
+
+  clutter_actor_show (stage);
+
+  clutter_threads_add_repaint_func_full (CLUTTER_REPAINT_FLAGS_POST_PAINT,
+                                         validate_stage,
+                                         data,
+                                         NULL);
+
+  while (!data->was_painted)
+    g_main_context_iteration (NULL, TRUE);
+
+  *result = data->result;
+
+  if (press_id != 0)
+    g_signal_handler_disconnect (stage, press_id);
+
+  g_free (data);
+
+  return *result == actor;
+}
+
+gboolean
+clutter_test_check_color_at_point (ClutterActor       *stage,
+                                   const ClutterPoint *point,
+                                   const ClutterColor *color,
+                                   ClutterColor       *result)
+{
+  ValidateData *data;
+  gboolean retval;
+  guint8 *buffer;
+  guint press_id = 0;
+
+  g_return_val_if_fail (CLUTTER_IS_STAGE (stage), FALSE);
+  g_return_val_if_fail (point != NULL, FALSE);
+  g_return_val_if_fail (color != NULL, FALSE);
+  g_return_val_if_fail (result != NULL, FALSE);
+
+  data = g_new0 (ValidateData, 1);
+  data->stage = stage;
+  data->point = *point;
+  data->check_color = TRUE;
+
+  if (g_test_verbose ())
+    {
+      g_printerr ("Press ESC to close the stage and resume the test\n");
+      press_id = g_signal_connect (stage, "key-press-event",
+                                   G_CALLBACK (on_key_press_event),
+                                   data);
+    }
+
+  clutter_actor_show (stage);
+
+  clutter_threads_add_repaint_func_full (CLUTTER_REPAINT_FLAGS_POST_PAINT,
+                                         validate_stage,
+                                         data,
+                                         NULL);
+
+  while (!data->was_painted)
+    g_main_context_iteration (NULL, TRUE);
+
+  if (press_id != 0)
+    g_signal_handler_disconnect (stage, press_id);
+
+  buffer = data->result;
+
+  clutter_color_init (result, buffer[0], buffer[1], buffer[2], 255);
+
+  /* we only check the color channels, so we can't use clutter_color_equal() */
+  retval = buffer[0] == color->red &&
+           buffer[1] == color->green &&
+           buffer[2] == color->blue;
+
+  g_free (data->result);
+  g_free (data);
+
+  return retval;
+}
diff --git a/clutter/clutter-test-utils.h b/clutter/clutter-test-utils.h
new file mode 100644
index 0000000..d88727d
--- /dev/null
+++ b/clutter/clutter-test-utils.h
@@ -0,0 +1,164 @@
+/*
+ * Clutter.
+ *
+ * An OpenGL based 'interactive canvas' library.
+ *
+ * Copyright (C) 2013  Emmanuele Bassi <ebassi gnome org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __CLUTTER_TEST_UTILS_H__
+#define __CLUTTER_TEST_UTILS_H__
+
+#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
+#error "Only <clutter/clutter.h> can be included directly."
+#endif
+
+#include <clutter/clutter-types.h>
+#include <clutter/clutter-actor.h>
+#include <clutter/clutter-color.h>
+
+G_BEGIN_DECLS
+
+/**
+ * CLUTTER_TEST_UNIT:
+ * @path: the GTest path for the test function
+ * @func: the GTestFunc function
+ *
+ * Adds @func at the given @path in the test suite.
+ *
+ * Since: 1.18
+ */
+#define CLUTTER_TEST_UNIT(path,func) \
+  clutter_test_add (path, func);
+
+/**
+ * CLUTTER_TEST_SUITE:
+ * @units: a list of %CLUTTER_TEST_UNIT definitions
+ *
+ * Defines the entry point and initializes a Clutter test unit, e.g.:
+ *
+ * |[
+ * CLUTTER_TEST_SUITE (
+ *   CLUTTER_TEST_UNIT ("/foobarize", foobarize)
+ *   CLUTTER_TEST_UNIT ("/bar-enabled", bar_enabled)
+ * )
+ * ]|
+ *
+ * Expands to:
+ *
+ * |[
+ * int
+ * main (int   argc,
+ *       char *argv[])
+ * {
+ *   clutter_test_init (&amp;argc, &amp;argv);
+ *
+ *   clutter_test_add ("/foobarize", foobarize);
+ *   clutter_test_add ("/bar-enabled", bar_enabled);
+ *
+ *   return clutter_test_run ();
+ * }
+ * ]|
+ *
+ * Since: 1.18
+ */
+#define CLUTTER_TEST_SUITE(units) \
+int \
+main (int argc, char *argv[]) \
+{ \
+  clutter_test_init (&argc, &argv); \
+\
+  { \
+    units \
+  } \
+\
+  return clutter_test_run (); \
+}
+
+CLUTTER_AVAILABLE_IN_1_18
+void            clutter_test_init               (int            *argc,
+                                                 char         ***argv);
+CLUTTER_AVAILABLE_IN_1_18
+int             clutter_test_run                (void);
+
+CLUTTER_AVAILABLE_IN_1_18
+void            clutter_test_add                (const char     *test_path,
+                                                 GTestFunc       test_func);
+CLUTTER_AVAILABLE_IN_1_18
+void            clutter_test_add_data           (const char     *test_path,
+                                                 GTestDataFunc   test_func,
+                                                 gpointer        test_data);
+CLUTTER_AVAILABLE_IN_1_18
+void            clutter_test_add_data_full      (const char     *test_path,
+                                                 GTestDataFunc   test_func,
+                                                 gpointer        test_data,
+                                                 GDestroyNotify  test_notify);
+
+CLUTTER_AVAILABLE_IN_1_18
+ClutterActor *  clutter_test_get_stage          (void);
+
+#define clutter_test_assert_actor_at_point(stage,point,actor) \
+G_STMT_START { \
+  const ClutterPoint *__p = (point); \
+  ClutterActor *__actor = (actor); \
+  ClutterActor *__stage = (stage); \
+  ClutterActor *__res; \
+  if (clutter_test_check_actor_at_point (__stage, __p, actor, &__res)) ; else { \
+    const char *__str1 = clutter_actor_get_name (__actor) != NULL \
+                       ? clutter_actor_get_name (__actor) \
+                       : G_OBJECT_TYPE_NAME (__actor); \
+    const char *__str2 = clutter_actor_get_name (__res) != NULL \
+                       ? clutter_actor_get_name (__res) \
+                       : G_OBJECT_TYPE_NAME (__res); \
+    char *__msg = g_strdup_printf ("assertion failed (actor %s at %.2f,%.2f): found actor %s", \
+                                   __str1, __p->x, __p->y, __str2); \
+    g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, __msg); \
+    g_free (__msg); \
+  } \
+} G_STMT_END
+
+#define clutter_test_assert_color_at_point(stage,point,color) \
+G_STMT_START { \
+  const ClutterPoint *__p = (point); \
+  const ClutterColor *__c = (color); \
+  ClutterActor *__stage = (stage); \
+  ClutterColor __res; \
+  if (clutter_test_check_color_at_point (__stage, __p, __c, &__res)) ; else { \
+    char *__str1 = clutter_color_to_string (__c); \
+    char *__str2 = clutter_color_to_string (&__res); \
+    char *__msg = g_strdup_printf ("assertion failed (color %s at %.2f,%.2f): found color %s", \
+                                   __str1, __p->x, __p->y, __str2); \
+    g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, __msg); \
+    g_free (__msg); \
+    g_free (__str1); \
+    g_free (__str2); \
+  } \
+} G_STMT_END
+
+CLUTTER_AVAILABLE_IN_1_18
+gboolean        clutter_test_check_actor_at_point       (ClutterActor       *stage,
+                                                         const ClutterPoint *point,
+                                                         ClutterActor       *actor,
+                                                         ClutterActor      **result);
+CLUTTER_AVAILABLE_IN_1_18
+gboolean        clutter_test_check_color_at_point       (ClutterActor       *stage,
+                                                         const ClutterPoint *point,
+                                                         const ClutterColor *color,
+                                                         ClutterColor       *result);
+
+G_END_DECLS
+
+#endif /* __CLUTTER_TEST_UTILS_H__ */
diff --git a/clutter/clutter.h b/clutter/clutter.h
index 0300099..4a612b7 100644
--- a/clutter/clutter.h
+++ b/clutter/clutter.h
@@ -99,6 +99,7 @@
 #include "clutter-stage.h"
 #include "clutter-stage-manager.h"
 #include "clutter-tap-action.h"
+#include "clutter-test-utils.h"
 #include "clutter-texture.h"
 #include "clutter-text.h"
 #include "clutter-timeline.h"
diff --git a/clutter/clutter.symbols b/clutter/clutter.symbols
index 0c54a7b..d34c94e 100644
--- a/clutter/clutter.symbols
+++ b/clutter/clutter.symbols
@@ -1364,6 +1364,14 @@ clutter_table_layout_set_span
 clutter_table_layout_set_use_animations
 clutter_tap_action_get_type
 clutter_tap_action_new
+clutter_test_add
+clutter_test_add_data
+clutter_test_add_data_full
+clutter_test_check_actor_at_point
+clutter_test_check_color_at_point
+clutter_test_get_stage
+clutter_test_init
+clutter_test_run
 clutter_texture_get_base_size
 clutter_texture_get_cogl_texture
 clutter_texture_get_cogl_material
diff --git a/configure.ac b/configure.ac
index fe06bb5..274fbf8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -191,12 +191,6 @@ AC_ARG_ENABLE([Bsymbolic],
 AS_IF([test "x$enable_Bsymbolic" = "xyes"], [CLUTTER_LINK_FLAGS=-Wl[,]-Bsymbolic-functions])
 AC_SUBST(CLUTTER_LINK_FLAGS)
 
-AC_ARG_ENABLE(installed_tests,
-              AS_HELP_STRING([--enable-installed-tests],
-                             [Install test programs (default: no)]),,
-              [enable_installed_tests=no])
-AM_CONDITIONAL(ENABLE_INSTALLED_TESTS, test x$enable_installed_tests = xyes)
-
 AC_CACHE_SAVE
 
 dnl ========================================================================
@@ -1125,16 +1119,7 @@ dnl = Build optionals =========================================================
 
 dnl === Conformance test suite ================================================
 
-AC_ARG_ENABLE([conformance],
-              [AS_HELP_STRING([--disable-conformance], [Whether the conformance tests should be built])],
-              [],
-              [enable_conformance=yes])
-
-AC_ARG_ENABLE([tests],
-              [AS_HELP_STRING([--disable-tests], [Whether tests should be built])],
-              [],
-              [enable_tests=yes])
-AM_CONDITIONAL(BUILD_TESTS, [test "x$enable_tests" = "xyes" && test "x$enable_conformance" = "xyes"])
+GLIB_TESTS
 
 AC_ARG_ENABLE([examples],
               [AS_HELP_STRING([--disable-examples], [Whether examples should be built])],
@@ -1168,8 +1153,6 @@ AC_CONFIG_FILES([
        tests/Makefile
        tests/accessibility/Makefile
        tests/conform/Makefile
-       tests/conform/test-launcher.sh
-       tests/data/Makefile
        tests/interactive/Makefile
        tests/interactive/wrapper.sh
        tests/micro-bench/Makefile
@@ -1224,9 +1207,10 @@ echo "        Build Additional Documentation: ${enable_docs} (Generate PDF: ${en
 echo ""
 echo " • Extra:"
 echo "        Build introspection data: ${enable_introspection}"
-echo "        Build test suites: ${enable_tests}"
-if test "x$enable_tests" = "xyes"; then
+if test "x$x11_tests" = "xyes"; then
 echo "        Build X11-specific tests: ${x11_tests}"
+fi
+if test "x$pixbuf_tests" = "xyes"; then
 echo "        Build tests using GDK-Pixbuf: ${pixbuf_tests}"
 fi
 echo "        Install test suites: ${enable_installed_tests}"
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 4b9b449..cb80c9f 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -31,7 +31,6 @@ LDADD = \
 AM_CFLAGS = $(CLUTTER_CFLAGS) $(GDK_PIXBUF_CFLAGS) $(MAINTAINER_CFLAGS)
 
 AM_CPPFLAGS = \
-       -DTESTS_DATADIR=\""$(abs_top_srcdir)/tests/data"\" \
        -DG_DISABLE_SINGLE_INCLUDES \
        -DGLIB_DISABLE_DEPRECATION_WARNINGS \
        -I$(top_srcdir) \
@@ -41,4 +40,6 @@ AM_CPPFLAGS = \
 
 noinst_PROGRAMS = $(all_examples)
 
+EXTRA_DIST = redhand.png
+
 -include $(top_srcdir)/build/autotools/Makefile.am.gitignore
diff --git a/examples/bin-layout.c b/examples/bin-layout.c
index 7dc9b96..b6098d6 100644
--- a/examples/bin-layout.c
+++ b/examples/bin-layout.c
@@ -222,7 +222,7 @@ main (int argc, char *argv[])
                     canvas);
 
   /* we use GdkPixbuf to load an image from our data directory */
-  pixbuf = gdk_pixbuf_new_from_file (TESTS_DATADIR G_DIR_SEPARATOR_S "redhand.png", NULL);
+  pixbuf = gdk_pixbuf_new_from_file ("redhand.png", NULL);
   image = clutter_image_new ();
   clutter_image_set_data (CLUTTER_IMAGE (image),
                           gdk_pixbuf_get_pixels (pixbuf),
diff --git a/examples/image-content.c b/examples/image-content.c
index 6232450..c9c01c6 100644
--- a/examples/image-content.c
+++ b/examples/image-content.c
@@ -69,7 +69,7 @@ main (int argc, char *argv[])
   clutter_actor_set_margin_left (stage, 12);
   clutter_actor_show (stage);
 
-  pixbuf = gdk_pixbuf_new_from_file (TESTS_DATADIR G_DIR_SEPARATOR_S "redhand.png", NULL);
+  pixbuf = gdk_pixbuf_new_from_file ("redhand.png", NULL);
   image = clutter_image_new ();
   clutter_image_set_data (CLUTTER_IMAGE (image),
                           gdk_pixbuf_get_pixels (pixbuf),
diff --git a/examples/pan-action.c b/examples/pan-action.c
index 71dcb24..e873305 100644
--- a/examples/pan-action.c
+++ b/examples/pan-action.c
@@ -15,7 +15,7 @@ create_content_actor (void)
   content = clutter_actor_new ();
   clutter_actor_set_size (content, 720, 720);
 
-  pixbuf = gdk_pixbuf_new_from_file (TESTS_DATADIR G_DIR_SEPARATOR_S "redhand.png", NULL);
+  pixbuf = gdk_pixbuf_new_from_file ("redhand.png", NULL);
   image = clutter_image_new ();
   clutter_image_set_data (CLUTTER_IMAGE (image),
                           gdk_pixbuf_get_pixels (pixbuf),
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 8526b39..65b474a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,3 +1,3 @@
-SUBDIRS = accessibility data conform interactive micro-bench performance
+SUBDIRS = accessibility conform interactive micro-bench performance
 
-EXTRA_DIST = README
+EXTRA_DIST = README clutter-1.0.suppressions
diff --git a/tests/data/clutter-1.0.suppressions b/tests/clutter-1.0.suppressions
similarity index 100%
rename from tests/data/clutter-1.0.suppressions
rename to tests/clutter-1.0.suppressions
diff --git a/tests/conform/Makefile.am b/tests/conform/Makefile.am
index 90f1f35..d0497d1 100644
--- a/tests/conform/Makefile.am
+++ b/tests/conform/Makefile.am
@@ -1,314 +1,43 @@
-include $(top_srcdir)/build/autotools/Makefile.am.silent
-
-NULL =
-
-BUILT_SOURCES =
-
-TESTS =
-check_PROGRAMS =
-check_SCRIPTS =
-
-EXTRA_DIST =
-DISTCLEANFILES =
-
-TEST_PROGS =
-
-# the common sources
-common_sources = \
-       test-conform-common.h   \
-       test-conform-common.c   \
-       test-conform-main.c     \
-       $(NULL)
-
-# the unit-specific sources; please: keep all sections in alphabetical order!
-units_sources =
-
-# animation tests
-units_sources += \
-       animator.c                      \
-       behaviours.c                    \
-       score.c                         \
-       state.c                         \
-       timeline.c                      \
-       timeline-interpolate.c          \
-       timeline-progress.c             \
-       timeline-rewind.c               \
-       $(NULL)
-
-# actors tests
-units_sources += \
-       actor-anchors.c                 \
-       actor-graph.c                   \
-       actor-destroy.c                 \
-       actor-invariants.c              \
-       actor-iter.c                    \
-       actor-layout.c                  \
-       actor-meta.c                    \
-       actor-offscreen-redirect.c      \
-       actor-offscreen-limit-max-size.c\
-       actor-paint-opacity.c           \
-       actor-pick.c                    \
-       actor-shader-effect.c           \
-       actor-size.c                    \
-       binding-pool.c                  \
-       cairo-texture.c                 \
-       group.c                         \
-       interval.c                      \
-       path.c                          \
-       rectangle.c                     \
-       texture-fbo.c                   \
-       texture.c                       \
-        text-cache.c                   \
-        text.c                         \
+include $(top_srcdir)/build/autotools/glib-tap.mk
+
+AM_CFLAGS = -g $(CLUTTER_CFLAGS) $(MAINTAINER_CFLAGS)
+LDADD = $(top_builddir)/clutter/libclutter-1.0.la $(CLUTTER_LIBS) -lm
+AM_LDFLAGS = -export-dynamic
+AM_CPPFLAGS = \
+       -DG_LOG_DOMAIN=\"Clutter-Conform\"      \
+       -I$(top_srcdir)                         \
+       -I$(top_builddir)                       \
+       -DCOGL_DISABLE_DEPRECATION_WARNINGS     \
+       $(CLUTTER_DEPRECATED_CFLAGS)            \
+       $(CLUTTER_DEBUG_CFLAGS)                 \
+       $(CLUTTER_PROFILE_CFLAGS)
+
+actor_tests = \
        $(NULL)
 
-# objects tests
-units_sources += \
-       color.c                         \
-       model.c                         \
-       script-parser.c                 \
-       units.c                         \
-        $(NULL)
-
-# cally tests
-units_sources += \
-       cally-text.c                    \
+general_tests = \
        $(NULL)
 
-# events tests
-units_sources += \
-       events-touch.c                  \
+deprecated_tests = \
        $(NULL)
 
-if OS_WIN32
-SHEXT =
-else
-SHEXT = $(EXEEXT)
-endif
-
-EXTRA_DIST += ADDING_NEW_TESTS test-launcher.sh.in run-tests.sh
-DISTCLEANFILES += test-launcher.sh .gitignore
-
-# For convenience, this provides a way to easily run individual unit tests:
-.PHONY: wrappers clean-wrappers
-
-#UNIT_TESTS = `./test-conformance -l -m thorough | $(GREP) '^/'`
-
-wrappers: stamp-test-conformance
-       @true
-stamp-test-conformance: Makefile $(srcdir)/test-conform-main.c
-       @mkdir -p wrappers
-       @sed -n \
-               -e 's/^ \{1,\}TEST_CONFORM_SIMPLE *(.*"\([^",]\{1,\}\)", 
*\([a-zA-Z0-9_]\{1,\}\).*/\/conform\1\/\2/p' \
-               -e 's/^ \{1,\}TEST_CONFORM_SKIP *(.*"\([^",]\{1,\}\)", 
*\([a-zA-Z0-9_]\{1,\}\).*/\/conform\1\/\2/p' \
-               -e 's/^ \{1,\}TEST_CONFORM_TODO *(.*"\([^",]\{1,\}\)", 
*\([a-zA-Z0-9_]\{1,\}\).*/\/conform\1\/\2/p' \
-       $(srcdir)/test-conform-main.c > unit-tests
-       @chmod +x test-launcher.sh
-       @( echo "/stamp-test-conformance" ; \
-          echo "/test-conformance" ; \
-          echo "*.o" ; \
-          echo "*.xml" ; \
-          echo "*.html" ; \
-          echo "*.test" ; \
-          echo ".gitignore" ; \
-          echo "test-suite.log" ; \
-          echo "unit-tests" ; \
-          echo "/wrappers/" ) > .gitignore
-       @for i in `cat unit-tests`; \
-       do \
-               unit=`basename $$i | sed -e s/_/-/g`; \
-               echo "  GEN      $$unit"; \
-               ( echo "#!/bin/sh" ; echo "$(abs_builddir)/test-launcher.sh '$$i' \"\$$ \"" ) > 
$$unit$(SHEXT) ; \
-               ( echo "#!/bin/sh" ; echo "exec $(abs_builddir)/test-conformance$(EXEEXT) -p $$i \"\$$ \"" ) 
wrappers/$$unit$(SHEXT) ; \
-               ( echo "test-conformance-clutter$(EXEEXT) -p $$i" ) > 
$(top_builddir)/build/win32/$$unit-clutter.bat ; \
-               ( echo "test-conformance-clutter$(EXEEXT) -p $$i" ) >> 
$(top_builddir)/build/win32/test-conformance-clutter.bat ; \
-               chmod +x $$unit$(SHEXT); \
-               chmod +x wrappers/$$unit$(SHEXT); \
-               echo "/$$unit$(SHEXT)" >> .gitignore; \
-       done \
-       && echo timestamp > $(@F)
-
-clean-wrappers:
-       @if test -f "unit-tests"; then \
-         for i in `cat unit-tests`; \
-         do \
-               unit=`basename $$i | sed -e s/_/-/g`; \
-               echo "  RM       $$unit"; \
-               rm -f $$unit$(SHEXT) ; \
-               rm -f wrappers/$$unit$(SHEXT) ; \
-         done \
-       fi \
-       && rm -rf wrappers \
-       && rm -f unit-tests \
-       && rm -f $(top_builddir)/build/win32/*.bat \
-       && rm -f stamp-test-conformance
-
-test_conformance_CPPFLAGS = \
-       -DG_DISABLE_SINGLE_INCLUDES \
-       -DCOGL_ENABLE_EXPERIMENTAL_API \
-       -DG_DISABLE_DEPRECATION_WARNINGS \
-       -DCOGL_DISABLE_DEPRECATION_WARNINGS \
-       -DCLUTTER_DISABLE_DEPRECATION_WARNINGS \
-       -DTESTS_DATADIR=\""$(top_srcdir)/tests/data"\" \
-       -I$(top_srcdir) \
-       -I$(top_builddir) \
-       -I$(top_srcdir)/clutter \
-       -I$(top_builddir)/clutter
-
-test_conformance_CFLAGS = -g $(CLUTTER_CFLAGS)
-test_conformance_LDADD = $(top_builddir)/clutter/libclutter- CLUTTER_API_VERSION@.la $(CLUTTER_LIBS) -lm
-test_conformance_LDFLAGS = -export-dynamic
-test_conformance_SOURCES = $(common_sources) $(units_sources)
-
-if OS_WIN32
-TESTS += test-conformance
-endif
-
-TEST_PROGS += test-conformance
-check_PROGRAMS += test-conformance
-check_SCRIPTS += wrappers
-
-test: wrappers
-       @export G_TEST_SRCDIR="$(abs_srcdir)" ; \
-        export G_TEST_BUILDDIR="$(abs_builddir)" ; \
-        $(top_srcdir)/tests/conform/run-tests.sh \
-         ./test-conformance$(EXEEXT) -o test-report.xml
-
-test-verbose: wrappers
-       @export G_TEST_SRCDIR="$(abs_srcdir)" ; \
-        export G_TEST_BUILDDIR="$(abs_builddir)" ; \
-        $(top_srcdir)/tests/conform/run-tests.sh \
-         ./test-conformance$(EXEEXT) -o test-report.xml --verbose
-
-.PHONY: test
-.PHONY: test-report perf-report full-report
-
-check-local: test
-
-GTESTER = gtester
-GTESTER_REPORT = gtester-report
-
-# test-report: run tests and generate report
-# perf-report: run tests 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}" || { \
-         export GTESTER_LOGDIR=`mktemp -d "$(srcdir)/.testlogs-XXXXXX"` ; \
-         if test -d "$(top_srcdir)/.git"; then \
-           export REVISION="`git describe`" ;  \
-         else \
-           export REVISION="$(VERSION) $(CLUTTER_RELEASE_STATUS)" ; \
-         fi ; \
-         export TIMESTAMP=`date +%Y-%m-%dT%H:%M:%S%z` ; \
-         case $@ in \
-         test-report) test_options="-k";; \
-         perf-report) test_options="-k -m=perf";; \
-         full-report) test_options="-k -m=perf -m=slow";; \
-         esac ; \
-         export G_TEST_SRCDIR="$(abs_srcdir)" ; \
-         export G_TEST_BUILDDIR="$(abs_builddir)" ; \
-         $(top_srcdir)/tests/conform/run-tests.sh \
-           ./test-conformance$(EXEEXT) \
-           --verbose \
-           $$test_options \
-           -o `mktemp "$$GTESTER_LOGDIR/log-XXXXXX"` ; \
-         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 "  <date>$$TIMESTAMP</date>"        >> $  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 ; \
-         ${GTESTER_REPORT} --version 2>/dev/null 1>&2 ; test "$$?" != 0 || ${GTESTER_REPORT} $  xml >$  html 
; \
-         rm -rf "$$GTESTER_LOGDIR" ; \
-       }
-
-XML_REPORTS = \
-       test-report.xml         \
-       perf-report.xml         \
-       full-report.xml         \
-       test-report-npot.xml    \
-       perf-report-npot.xml    \
-       full-report-npot.xml
-
-HTML_REPORTS = \
-       test-report.html        \
-       perf-report.html        \
-       full-report.html        \
-       test-report-npot.html   \
-       perf-report-npot.html   \
-       full-report-npot.html
-
-dist-hook: $(top_builddir)/build/win32/vs9/test-conformance-clutter.vcproj 
$(top_builddir)/build/win32/vs10/test-conformance-clutter.vcxproj 
$(top_builddir)/build/win32/vs10/test-conformance-clutter.vcxproj.filters
-
-$(top_builddir)/build/win32/vs9/test-conformance-clutter.vcproj: 
$(top_srcdir)/build/win32/vs9/test-conformance-clutter.vcprojin
-       @for F in $(test_conformance_SOURCES); do \
-               case $$F in \
-               *.c)    echo '   <File RelativePath="..\..\..\tests\conform\'$$F'" />' \
-                       ;; \
-               esac; \
-       done > testconformance.sourcefiles
-       $(CPP) -P - <$(top_srcdir)/build/win32/vs9/test-conformance-clutter.vcprojin >$@
-       rm -f testconformance.sourcefiles
-
-$(top_builddir)/build/win32/vs10/test-conformance-clutter.vcxproj: 
$(top_srcdir)/build/win32/vs10/test-conformance-clutter.vcxprojin
-       @for F in $(test_conformance_SOURCES); do \
-               case $$F in \
-               *.c)    echo '    <ClCompile Include="..\..\..\tests\conform\'$$F'" />' \
-                       ;; \
-               esac; \
-       done >testconformance.vs10.sourcefiles
-       $(CPP) -P - <$(top_srcdir)/build/win32/vs10/test-conformance-clutter.vcxprojin >$@
-       rm -f testconformance.vs10.sourcefiles
-       
-$(top_builddir)/build/win32/vs10/test-conformance-clutter.vcxproj.filters: 
$(top_srcdir)/build/win32/vs10/test-conformance-clutter.vcxproj.filtersin
-       @for F in $(test_conformance_SOURCES); do \
-               case $$F in \
-               *.c)    echo '    <ClCompile 
Include="..\..\..\tests\conform\'$$F'"><Filter>Sources</Filter></ClCompile>' \
-                       ;; \
-               esac; \
-       done > testconformance.vs10.sourcefiles.filters
-       $(CPP) -P - < $(top_srcdir)/build/win32/vs10/test-conformance-clutter.vcxproj.filtersin > $@
-       rm -f testconformance.vs10.sourcefiles.filters
-
-# Let the VS9/VS10 Project files be cleared out before they are re-expanded...
-DISTCLEANFILES += \
-       $(top_builddir)/build/win32/vs9/test-conformance-clutter.vcproj \
-       $(top_builddir)/build/win32/vs10/test-conformance-clutter.vcxproj \
-       $(top_builddir)/build/win32/vs10/test-conformance-clutter.vcxproj.filters
-
-# we override the clean-generic target to clean up the wrappers so
-# we cannot use CLEANFILES
-clean-generic: clean-wrappers clean-tests
-       $(QUIET_RM)rm -f $(XML_REPORTS) $(HTML_REPORTS)
-
-if ENABLE_INSTALLED_TESTS
-# installed tests
-insttestdir = $(libexecdir)/installed-tests/$(PACKAGE)/conform
-insttest_PROGRAMS = test-conformance
-
-testmetadir = $(datadir)/installed-tests/$(PACKAGE)
-testmeta_DATA = $(wildcard *.test)
-
-BUILT_SOURCES += tests
-endif
-
-.PHONY: tests clean-tests
-
-tests: stamp-test-conformance
-       @for i in `cat unit-tests`; do \
-               unit=`basename $$i | sed -e s/_/-/g`; \
-               echo "  GEN      $$unit"; \
-               echo "[Test]" > $$unit.test; \
-               echo "Type=session" >> $$unit.test; \
-               echo "Exec=$(libexecdir)/installed-tests/$(PACKAGE)/conform/test-conformance -p $$i" >> 
$$unit.test; \
-       done
-
-clean-tests:
-       $(QUIET_RM) rm -f *.test
+test_programs = $(actor_tests) $(general_tests) $(deprecated_tests)
+
+dist_test_data = $(script_ui_files)
+script_ui_files = $(addprefix scripts/,$(script_tests))
+script_tests = \
+       test-animator-1.json \
+       test-animator-2.json \
+       test-animator-3.json \
+       test-script-animation.json \
+       test-script-child.json \
+       test-script-implicit-alpha.json \
+       test-script-interval.json \
+       test-script-layout-property.json \
+       test-script-margin.json \
+       test-script-model.json \
+       test-script-named-object.json \
+       test-script-object-property.json \
+       test-script-single.json \
+       test-script-timeline-markers.json \
+       test-state-1.json
diff --git a/tests/data/test-animator-1.json b/tests/conform/scripts/test-animator-1.json
similarity index 100%
rename from tests/data/test-animator-1.json
rename to tests/conform/scripts/test-animator-1.json
diff --git a/tests/data/test-animator-2.json b/tests/conform/scripts/test-animator-2.json
similarity index 100%
rename from tests/data/test-animator-2.json
rename to tests/conform/scripts/test-animator-2.json
diff --git a/tests/data/test-animator-3.json b/tests/conform/scripts/test-animator-3.json
similarity index 100%
rename from tests/data/test-animator-3.json
rename to tests/conform/scripts/test-animator-3.json
diff --git a/tests/data/test-script-animation.json b/tests/conform/scripts/test-script-animation.json
similarity index 100%
rename from tests/data/test-script-animation.json
rename to tests/conform/scripts/test-script-animation.json
diff --git a/tests/data/test-script-child.json b/tests/conform/scripts/test-script-child.json
similarity index 100%
rename from tests/data/test-script-child.json
rename to tests/conform/scripts/test-script-child.json
diff --git a/tests/data/test-script-implicit-alpha.json 
b/tests/conform/scripts/test-script-implicit-alpha.json
similarity index 100%
rename from tests/data/test-script-implicit-alpha.json
rename to tests/conform/scripts/test-script-implicit-alpha.json
diff --git a/tests/data/test-script-interval.json b/tests/conform/scripts/test-script-interval.json
similarity index 100%
rename from tests/data/test-script-interval.json
rename to tests/conform/scripts/test-script-interval.json
diff --git a/tests/data/test-script-layout-property.json 
b/tests/conform/scripts/test-script-layout-property.json
similarity index 100%
rename from tests/data/test-script-layout-property.json
rename to tests/conform/scripts/test-script-layout-property.json
diff --git a/tests/data/test-script-margin.json b/tests/conform/scripts/test-script-margin.json
similarity index 100%
rename from tests/data/test-script-margin.json
rename to tests/conform/scripts/test-script-margin.json
diff --git a/tests/data/test-script-model.json b/tests/conform/scripts/test-script-model.json
similarity index 100%
rename from tests/data/test-script-model.json
rename to tests/conform/scripts/test-script-model.json
diff --git a/tests/data/test-script-named-object.json b/tests/conform/scripts/test-script-named-object.json
similarity index 100%
rename from tests/data/test-script-named-object.json
rename to tests/conform/scripts/test-script-named-object.json
diff --git a/tests/data/test-script-object-property.json 
b/tests/conform/scripts/test-script-object-property.json
similarity index 100%
rename from tests/data/test-script-object-property.json
rename to tests/conform/scripts/test-script-object-property.json
diff --git a/tests/data/test-script-single.json b/tests/conform/scripts/test-script-single.json
similarity index 100%
rename from tests/data/test-script-single.json
rename to tests/conform/scripts/test-script-single.json
diff --git a/tests/data/test-script-timeline-markers.json 
b/tests/conform/scripts/test-script-timeline-markers.json
similarity index 100%
rename from tests/data/test-script-timeline-markers.json
rename to tests/conform/scripts/test-script-timeline-markers.json
diff --git a/tests/data/test-state-1.json b/tests/conform/scripts/test-state-1.json
similarity index 100%
rename from tests/data/test-state-1.json
rename to tests/conform/scripts/test-state-1.json
diff --git a/tests/interactive/Makefile.am b/tests/interactive/Makefile.am
index 8e87edf..8bea2bc 100644
--- a/tests/interactive/Makefile.am
+++ b/tests/interactive/Makefile.am
@@ -148,7 +148,7 @@ test_interactive_SOURCES = test-main.c $(UNIT_TESTS)
 nodist_test_interactive_SOURCES = test-unit-names.h
 test_interactive_CFLAGS = $(CLUTTER_CFLAGS) $(GDK_PIXBUF_CFLAGS)
 test_interactive_CPPFLAGS = \
-       -DTESTS_DATADIR=\""$(abs_top_srcdir)/tests/data"\" \
+       -DTESTS_DATADIR=\""$(abs_srcdir)"\" \
        -DG_DISABLE_SINGLE_INCLUDES \
        -DGLIB_DISABLE_DEPRECATION_WARNINGS \
        -DCOGL_DISABLE_DEPRECATION_WARNINGS \
@@ -161,8 +161,11 @@ test_interactive_LDFLAGS = -export-dynamic
 test_interactive_LDADD = $(CLUTTER_LIBS) $(GDK_PIXBUF_LIBS) $(common_ldadd) -lm
 
 EXTRA_DIST = \
-       wrapper.sh.in                   \
-       $(top_builddir)/build/win32/test-unit-names.h
+       wrapper.sh.in \
+       $(top_builddir)/build/win32/test-unit-names.h \
+       test-script.json \
+       test-script-signals.json \
+       redhand.png
 
 DISTCLEANFILES = wrapper.sh .gitignore test-unit-names.h
 
diff --git a/tests/data/test-script-signals.json b/tests/interactive/test-script-signals.json
similarity index 100%
rename from tests/data/test-script-signals.json
rename to tests/interactive/test-script-signals.json
diff --git a/tests/data/test-script.json b/tests/interactive/test-script.json
similarity index 100%
rename from tests/data/test-script.json
rename to tests/interactive/test-script.json
diff --git a/tests/interactive/test-state-script.c b/tests/interactive/test-state-script.c
index e777d89..34b1b87 100644
--- a/tests/interactive/test-state-script.c
+++ b/tests/interactive/test-state-script.c
@@ -4,7 +4,7 @@
 
 #include <clutter/clutter.h>
 
-#define TEST_STATE_SCRIPT_FILE  TESTS_DATADIR G_DIR_SEPARATOR_S "test-script-signals.json"
+#define TEST_STATE_SCRIPT_FILE  "test-script-signals.json"
 
 gboolean
 on_button_press (ClutterActor *actor,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]