From 615fe1e7039e08ad2b795370f905a028790d1f2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Sun, 2 Jun 2024 20:20:03 +0200 Subject: [PATCH] tests/cogl/conform: Skip known failing tests parts in undefined mode When running the tests in non-undefined mode we should skip the known failing tests instead of the whole suite, so mark them as such so that we can still run the tests partially checking the things that still work, avoiding to regress on them too. We also run the tests in normal mode so that we can ensure that the failures are still happening in that way. Part-of: --- src/tests/cogl/conform/meson.build | 10 +++- .../conform/test-point-sprite-known-failure.c | 48 +++++++++++-------- .../cogl/conform/test-read-texture-formats.c | 17 +++++-- 3 files changed, 49 insertions(+), 26 deletions(-) diff --git a/src/tests/cogl/conform/meson.build b/src/tests/cogl/conform/meson.build index 30bb55fe6..030715017 100644 --- a/src/tests/cogl/conform/meson.build +++ b/src/tests/cogl/conform/meson.build @@ -95,7 +95,15 @@ foreach cogl_test: cogl_tests suite: ['cogl', 'cogl/conform'], env: variant_test_env, is_parallel: false, - should_fail: variant in known_failures, ) + + if variant in known_failures + test('-'.join([test_name, 'should-fail', variant]), test_executable, + suite: ['cogl', 'cogl/conform', 'failing'], + env: variant_test_env, + is_parallel: false, + should_fail: true, + ) + endif endforeach endforeach diff --git a/src/tests/cogl/conform/test-point-sprite-known-failure.c b/src/tests/cogl/conform/test-point-sprite-known-failure.c index 5808fea51..365112a10 100644 --- a/src/tests/cogl/conform/test-point-sprite-known-failure.c +++ b/src/tests/cogl/conform/test-point-sprite-known-failure.c @@ -138,26 +138,34 @@ do_test (gboolean check_orientation, g_object_unref (pipeline); g_object_unref (tex_2d); - test_utils_check_pixel (test_fb, - POINT_SIZE - POINT_SIZE / 4, - POINT_SIZE - POINT_SIZE / 4, - 0x0000ffff); - test_utils_check_pixel (test_fb, - POINT_SIZE + POINT_SIZE / 4, - POINT_SIZE - POINT_SIZE / 4, - 0x00ff00ff); - test_utils_check_pixel (test_fb, - POINT_SIZE - POINT_SIZE / 4, - POINT_SIZE + POINT_SIZE / 4, - check_orientation ? - 0x00ffffff : - 0x0000ffff); - test_utils_check_pixel (test_fb, - POINT_SIZE + POINT_SIZE / 4, - POINT_SIZE + POINT_SIZE / 4, - check_orientation ? - 0xff0000ff : - 0x00ff00ff); + if (!g_test_undefined ()) + { + /* This test case is always considered failing */ + g_test_skip_printf ("This test is a well known failure"); + } + else + { + test_utils_check_pixel (test_fb, + POINT_SIZE - POINT_SIZE / 4, + POINT_SIZE - POINT_SIZE / 4, + 0x0000ffff); + test_utils_check_pixel (test_fb, + POINT_SIZE + POINT_SIZE / 4, + POINT_SIZE - POINT_SIZE / 4, + 0x00ff00ff); + test_utils_check_pixel (test_fb, + POINT_SIZE - POINT_SIZE / 4, + POINT_SIZE + POINT_SIZE / 4, + check_orientation ? + 0x00ffffff : + 0x0000ffff); + test_utils_check_pixel (test_fb, + POINT_SIZE + POINT_SIZE / 4, + POINT_SIZE + POINT_SIZE / 4, + check_orientation ? + 0xff0000ff : + 0x00ff00ff); + } /* When rendering without the point sprites all of the texture coordinates should be 0,0 so it should get the top-left texel diff --git a/src/tests/cogl/conform/test-read-texture-formats.c b/src/tests/cogl/conform/test-read-texture-formats.c index 732808c44..583ab8bb8 100644 --- a/src/tests/cogl/conform/test-read-texture-formats.c +++ b/src/tests/cogl/conform/test-read-texture-formats.c @@ -187,8 +187,8 @@ test_read_int_case (gconstpointer data) const TestFormatArgs *args = data; g_autoptr (CoglTexture) tex_2d = NULL; uint32_t received_value; - char *received_value_str; - char *expected_value_str; + g_autofree char *received_value_str = NULL; + g_autofree char *expected_value_str = NULL; tex_2d = g_steal_pointer ((CoglTexture **) &args->tex_2d); @@ -199,10 +199,17 @@ test_read_int_case (gconstpointer data) received_value_str = g_strdup_printf ("0x%08x", received_value); expected_value_str = g_strdup_printf ("0x%08x", args->expected_value); - g_assert_cmpstr (received_value_str, ==, expected_value_str); - g_free (received_value_str); - g_free (expected_value_str); + if (!g_test_undefined ()) + { + /* This test case is always considered failing */ + g_test_skip_printf ("This test is a well known failure, " + "expected: '%s', actual: '%s'", + expected_value_str, received_value_str); + return; + } + + g_assert_cmpstr (received_value_str, ==, expected_value_str); } static void