diff options
author | Emmanuele Bassi <ebassi@gmail.com> | 2020-03-10 16:03:11 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gmail.com> | 2020-03-10 16:03:11 +0000 |
commit | b08e3cbc8c8aea1a52a998cdbbc84e53d32e310c (patch) | |
tree | 44355e686dd07c981b545eeadc3bda3d36b4788b | |
parent | 24da6903240267c44015f251e3c4dbea8513e7ee (diff) | |
parent | 2e7271aa1518a7f665785fa1ba2632c38a8cd888 (diff) | |
download | cogl-b08e3cbc8c8aea1a52a998cdbbc84e53d32e310c.tar.gz |
Merge branch 'wip/smcv/tests-skip' into 'cogl-1.22'
[1.22] Normally skip tests that are not expected to succeed
See merge request GNOME/cogl!15
-rw-r--r-- | test-fixtures/test-utils.c | 4 | ||||
-rw-r--r-- | test-fixtures/test-utils.h | 2 | ||||
-rw-r--r-- | tests/conform/test-conform-main.c | 15 | ||||
-rw-r--r-- | tests/unit/test-unit-main.c | 18 |
4 files changed, 27 insertions, 12 deletions
diff --git a/test-fixtures/test-utils.c b/test-fixtures/test-utils.c index a08fda0e..ea9ad76c 100644 --- a/test-fixtures/test-utils.c +++ b/test-fixtures/test-utils.c @@ -125,7 +125,7 @@ is_boolean_env_set (const char *variable) return ret; } -void +CoglBool test_utils_init (TestFlags requirement_flags, TestFlags known_failure_flags) { @@ -204,6 +204,8 @@ test_utils_init (TestFlags requirement_flags, g_print ("WARNING: Missing required feature[s] for this test\n"); else if (known_failure) g_print ("WARNING: Test is known to fail\n"); + + return (!missing_requirement && !known_failure); } void diff --git a/test-fixtures/test-utils.h b/test-fixtures/test-utils.h index 9c3ced9b..e59163c8 100644 --- a/test-fixtures/test-utils.h +++ b/test-fixtures/test-utils.h @@ -69,7 +69,7 @@ typedef enum { extern CoglContext *test_ctx; extern CoglFramebuffer *test_fb; -void +CoglBool test_utils_init (TestFlags requirement_flags, TestFlags known_failure_flags); diff --git a/tests/conform/test-conform-main.c b/tests/conform/test-conform-main.c index ee668999..63ae15f9 100644 --- a/tests/conform/test-conform-main.c +++ b/tests/conform/test-conform-main.c @@ -15,10 +15,17 @@ extern void FUNC (void); \ if (strcmp (#FUNC, argv[1]) == 0) \ { \ - test_utils_init (REQUIREMENTS, KNOWN_FAIL_REQUIREMENTS); \ - FUNC (); \ - test_utils_fini (); \ - exit (0); \ + if (test_utils_init (REQUIREMENTS, KNOWN_FAIL_REQUIREMENTS) \ + || g_getenv ("COGL_TEST_TRY_EVERYTHING") != NULL) \ + { \ + FUNC (); \ + test_utils_fini (); \ + exit (0); \ + } \ + else \ + { \ + exit (1); \ + } \ } \ } G_STMT_END diff --git a/tests/unit/test-unit-main.c b/tests/unit/test-unit-main.c index b1f78645..6065b083 100644 --- a/tests/unit/test-unit-main.c +++ b/tests/unit/test-unit-main.c @@ -36,10 +36,16 @@ main (int argc, char **argv) return 1; } - test_utils_init (unit_test->requirement_flags, - unit_test->known_failure_flags); - unit_test->run (); - test_utils_fini (); - - return 0; + if (test_utils_init (unit_test->requirement_flags, + unit_test->known_failure_flags) + || g_getenv ("COGL_TEST_TRY_EVERYTHING") != NULL) + { + unit_test->run (); + test_utils_fini (); + return 0; + } + else + { + return 1; + } } |