Merge branch 'wip/smcv/test-timeout' into 'cogl-1.22'
[1.22] Terminate tests with SIGALRM if they take more than 120 seconds See merge request GNOME/cogl!11
This commit is contained in:
commit
1ddbbf0c09
|
@ -1373,6 +1373,8 @@ dnl ================================================================
|
||||||
dnl Checks for library functions.
|
dnl Checks for library functions.
|
||||||
dnl ================================================================
|
dnl ================================================================
|
||||||
|
|
||||||
|
AC_CHECK_FUNCS_ONCE([alarm])
|
||||||
|
|
||||||
dnl The 'ffs' function is part of C99 so it isn't always
|
dnl The 'ffs' function is part of C99 so it isn't always
|
||||||
dnl available. Cogl has a fallback if needed.
|
dnl available. Cogl has a fallback if needed.
|
||||||
dnl
|
dnl
|
||||||
|
|
|
@ -2,6 +2,10 @@
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "test-unit.h"
|
#include "test-unit.h"
|
||||||
#include "test-utils.h"
|
#include "test-utils.h"
|
||||||
|
|
||||||
|
@ -146,6 +150,11 @@ test_utils_init (TestFlags requirement_flags,
|
||||||
"$ make test-report");
|
"$ make test-report");
|
||||||
counter++;
|
counter++;
|
||||||
|
|
||||||
|
#ifdef HAVE_ALARM
|
||||||
|
/* Kill the test with SIGALRM if it takes more than this many seconds */
|
||||||
|
alarm (120);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (is_boolean_env_set ("COGL_TEST_VERBOSE") ||
|
if (is_boolean_env_set ("COGL_TEST_VERBOSE") ||
|
||||||
is_boolean_env_set ("V"))
|
is_boolean_env_set ("V"))
|
||||||
cogl_test_is_verbose = TRUE;
|
cogl_test_is_verbose = TRUE;
|
||||||
|
|
Loading…
Reference in New Issue