mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-01 05:13:06 +02:00
glib/tests/collate.c: run to completion when skipping all tests
Otherwise, we don't produce valid TAP output, and fail with: ERROR: collate - missing test plan Bug: https://bugzilla.gnome.org/show_bug.cgi?id=724124 Reviewed-by: Dan Winship <danw>
This commit is contained in:
parent
169846c5ab
commit
ffa5fab09a
@ -3,6 +3,8 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
static gboolean missing_locale = FALSE;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
const gchar **input;
|
const gchar **input;
|
||||||
const gchar **sorted;
|
const gchar **sorted;
|
||||||
@ -45,6 +47,12 @@ do_collate (gboolean for_file, gboolean use_key, const CollateTest *test)
|
|||||||
Line line;
|
Line line;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
|
if (missing_locale)
|
||||||
|
{
|
||||||
|
g_test_skip ("no en_US locale");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
line_array = g_array_new (FALSE, FALSE, sizeof(Line));
|
line_array = g_array_new (FALSE, FALSE, sizeof(Line));
|
||||||
g_array_set_clear_func (line_array, (GDestroyNotify)clear_line);
|
g_array_set_clear_func (line_array, (GDestroyNotify)clear_line);
|
||||||
|
|
||||||
@ -253,8 +261,10 @@ main (int argc, char *argv[])
|
|||||||
locale = setlocale (LC_ALL, "");
|
locale = setlocale (LC_ALL, "");
|
||||||
if (locale == NULL || strcmp (locale, "en_US") != 0)
|
if (locale == NULL || strcmp (locale, "en_US") != 0)
|
||||||
{
|
{
|
||||||
g_test_message ("No suitable locale, skipping test");
|
g_test_message ("No suitable locale, skipping tests");
|
||||||
return 0;
|
missing_locale = TRUE;
|
||||||
|
/* let the tests run to completion so they show up as SKIP'd in TAP
|
||||||
|
* output */
|
||||||
}
|
}
|
||||||
|
|
||||||
test[0].input = input0;
|
test[0].input = input0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user