diff options
-rwxr-xr-x | autogen.sh | 18 | ||||
-rw-r--r-- | cogl/driver/gl/gles/cogl-driver-gles.c | 1 | ||||
-rw-r--r-- | configure.ac | 16 | ||||
-rw-r--r-- | test-fixtures/test-utils.c | 12 | ||||
-rw-r--r-- | tests/conform/test-atlas-migration.c | 6 | ||||
-rw-r--r-- | tests/conform/test-backface-culling.c | 3 | ||||
-rw-r--r-- | tests/conform/test-conform-main.c | 2 | ||||
-rw-r--r-- | tests/conform/test-premult.c | 6 | ||||
-rwxr-xr-x | tests/run-tests.sh | 10 |
9 files changed, 50 insertions, 24 deletions
@@ -16,21 +16,13 @@ test $TEST_TYPE $FILE || { exit 1 } -AUTOMAKE_VERSIONS="1.16 1.15 1.14 1.13 1.12 1.11" -for version in $AUTOMAKE_VERSIONS; do - if automake-$version --version < /dev/null > /dev/null 2>&1 ; then - AUTOMAKE=automake-$version - ACLOCAL=aclocal-$version - export AUTOMAKE ACLOCAL - break - fi -done - -if test -z "$AUTOMAKE"; then +if ! command -v "${AUTOMAKE-automake}" >/dev/null; then echo - echo "You must have one of automake $AUTOMAKE_VERSIONS to compile $PROJECT." + echo "You must have automake >= 1.11 to compile $PROJECT." echo "Install the appropriate package for your distribution," echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/" + echo "To use a non-default version, set the AUTOMAKE and ACLOCAL" + echo "environment variables." exit 1 fi @@ -49,7 +41,7 @@ if test -z "$NOCONFIGURE"; then fi if test -z "$ACLOCAL_FLAGS"; then - acdir=`$ACLOCAL --print-ac-dir` + acdir=`${ACLOCAL-aclocal} --print-ac-dir` m4list="glib-2.0.m4" for file in $m4list; do if [ ! -f "$acdir/$file" ]; then diff --git a/cogl/driver/gl/gles/cogl-driver-gles.c b/cogl/driver/gl/gles/cogl-driver-gles.c index e94449f4..d8d1d0ad 100644 --- a/cogl/driver/gl/gles/cogl-driver-gles.c +++ b/cogl/driver/gl/gles/cogl-driver-gles.c @@ -201,6 +201,7 @@ _cogl_driver_pixel_format_to_gl (CoglContext *context, case COGL_PIXEL_FORMAT_ANY: case COGL_PIXEL_FORMAT_YUV: + default: g_assert_not_reached (); break; } diff --git a/configure.ac b/configure.ac index a9a81c9d..1f0c6060 100644 --- a/configure.ac +++ b/configure.ac @@ -685,10 +685,15 @@ AS_IF([test "x$enable_gles1" = "xyes"], AC_SUBST([COGL_EGL_INCLUDES]) AC_CHECK_HEADERS([EGL/eglext.h], - [COGL_EGL_INCLUDES="$COGL_EGL_INCLUDE + [COGL_EGL_INCLUDES="$COGL_EGL_INCLUDES #include <EGL/eglext.h>"], [], [$COGL_EGL_INCLUDES]) + AC_CHECK_HEADERS([EGL/eglmesaext.h], + [COGL_EGL_INCLUDES="$COGL_EGL_INCLUDES +#include <EGL/eglmesaext.h>"], + [], + [$COGL_EGL_INCLUDES]) # Check for a GLES 1.x Common Profile library with/without EGL. # @@ -1216,6 +1221,12 @@ AS_IF([test "x$NEED_EGL" = "xyes" && test "x$EGL_CHECKED" != "xyes"], [], [AC_MSG_ERROR([Unable to locate required EGL headers])], [#include <EGL/egl.h>]) + AC_CHECK_HEADERS( + [EGL/eglmesaext.h], + [], + [AC_MSG_ERROR([Unable to locate required EGL headers])], + [#include <EGL/egl.h> +#include <EGL/eglext.h>]) AC_CHECK_LIB(EGL, [eglInitialize], [COGL_EXTRA_LDFLAGS="$COGL_EXTRA_LDFLAGS -lEGL"], @@ -1226,7 +1237,8 @@ AS_IF([test "x$NEED_EGL" = "xyes" && test "x$EGL_CHECKED" != "xyes"], ) COGL_EGL_INCLUDES="#include <EGL/egl.h> -#include <EGL/eglext.h>" +#include <EGL/eglext.h> +#include <EGL/eglmesaext.h>" AC_SUBST([COGL_EGL_INCLUDES]) ]) diff --git a/test-fixtures/test-utils.c b/test-fixtures/test-utils.c index fcb0d4c0..ea9ad76c 100644 --- a/test-fixtures/test-utils.c +++ b/test-fixtures/test-utils.c @@ -300,7 +300,17 @@ void test_utils_check_pixel_rgb (CoglFramebuffer *test_fb, int x, int y, int r, int g, int b) { - test_utils_check_pixel (test_fb, x, y, (r << 24) | (g << 16) | (b << 8)); + g_return_if_fail (r >= 0); + g_return_if_fail (g >= 0); + g_return_if_fail (b >= 0); + g_return_if_fail (r <= 0xFF); + g_return_if_fail (g <= 0xFF); + g_return_if_fail (b <= 0xFF); + + test_utils_check_pixel (test_fb, x, y, + (((guint32) r) << 24) | + (((guint32) g) << 16) | + (((guint32) b) << 8)); } void diff --git a/tests/conform/test-atlas-migration.c b/tests/conform/test-atlas-migration.c index 39e8a3c1..60502760 100644 --- a/tests/conform/test-atlas-migration.c +++ b/tests/conform/test-atlas-migration.c @@ -98,9 +98,9 @@ verify_texture (CoglTexture *texture, int size) }; test_utils_compare_pixel (p, - (real_color.red << 24) | - (real_color.green << 16) | - (real_color.blue << 8) | + (((guint32) real_color.red) << 24) | + (((guint32) real_color.green) << 16) | + (((guint32) real_color.blue) << 8) | opacity); g_assert_cmpint (p[3], ==, opacity); diff --git a/tests/conform/test-backface-culling.c b/tests/conform/test-backface-culling.c index e90c2f5e..c06ec79a 100644 --- a/tests/conform/test-backface-culling.c +++ b/tests/conform/test-backface-culling.c @@ -193,6 +193,9 @@ validate_result (CoglFramebuffer *framebuffer, int y_offset) cull_front = TRUE; cull_back = TRUE; break; + + default: + g_assert_not_reached (); } if (FRONT_WINDING (draw_num) == COGL_WINDING_CLOCKWISE) diff --git a/tests/conform/test-conform-main.c b/tests/conform/test-conform-main.c index d84d755b..63ae15f9 100644 --- a/tests/conform/test-conform-main.c +++ b/tests/conform/test-conform-main.c @@ -62,7 +62,7 @@ main (int argc, char **argv) ADD_TEST (test_pipeline_user_matrix, 0, 0); ADD_TEST (test_blend_strings, 0, 0); ADD_TEST (test_blend, 0, 0); - ADD_TEST (test_premult, 0, TEST_KNOWN_FAILURE); + ADD_TEST (test_premult, 0, 0); UNPORTED_TEST (test_readpixels); #ifdef COGL_HAS_COGL_PATH_SUPPORT ADD_TEST (test_path, 0, 0); diff --git a/tests/conform/test-premult.c b/tests/conform/test-premult.c index fa60bdf1..9ac7b680 100644 --- a/tests/conform/test-premult.c +++ b/tests/conform/test-premult.c @@ -49,6 +49,7 @@ make_texture (uint32_t color, CoglPixelFormat src_format, MakeTextureFlags flags) { + static CoglUserDataKey bitmap_free_key; CoglTexture2D *tex_2d; guchar *tex_data = gen_tex_data (color); CoglBitmap *bmp = cogl_bitmap_new_for_data (test_ctx, @@ -57,6 +58,10 @@ make_texture (uint32_t color, src_format, QUAD_WIDTH * 4, tex_data); + cogl_object_set_user_data (COGL_OBJECT (bmp), + &bitmap_free_key, + tex_data, + g_free); tex_2d = cogl_texture_2d_new_from_bitmap (bmp); @@ -66,7 +71,6 @@ make_texture (uint32_t color, cogl_texture_set_premultiplied (tex_2d, FALSE); cogl_object_unref (bmp); - g_free (tex_data); return tex_2d; } diff --git a/tests/run-tests.sh b/tests/run-tests.sh index 7e62bf0f..763e173b 100755 --- a/tests/run-tests.sh +++ b/tests/run-tests.sh @@ -18,6 +18,8 @@ shift set +m +LOG=$(mktemp) + trap "" ERR trap "" SIGABRT trap "" SIGFPE @@ -62,17 +64,17 @@ get_status() run_test() { - $($TEST_BINARY $1 &>.log) + $($TEST_BINARY $1 &> "$LOG") TMP=$? var_name=$2_result eval $var_name=$TMP - if grep -q "$MISSING_FEATURE" .log; then + if grep -q "$MISSING_FEATURE" "$LOG"; then if test $TMP -ne 0; then eval $var_name=500 else eval $var_name=400 fi - elif grep -q "$KNOWN_FAILURE" .log; then + elif grep -q "$KNOWN_FAILURE" "$LOG"; then if test $TMP -ne 0; then eval $var_name=300 else @@ -154,4 +156,6 @@ do echo "" done +rm "$LOG" + exit $EXIT |