summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2014-02-11 15:14:33 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-02-13 14:31:09 +0000
commitffa5fab09a504cc6d2ff862b4cff123e27e118e1 (patch)
tree7cb5aec74a5af083f510e4648e96df3401ab0298
parent169846c5ab19abaa5474f5b5f30c3deef645ee03 (diff)
downloadglib-ffa5fab09a504cc6d2ff862b4cff123e27e118e1.tar.gz
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>
-rw-r--r--glib/tests/collate.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/glib/tests/collate.c b/glib/tests/collate.c
index a6fda187c..24a913d24 100644
--- a/glib/tests/collate.c
+++ b/glib/tests/collate.c
@@ -3,6 +3,8 @@
#include <stdlib.h>
#include <string.h>
+static gboolean missing_locale = FALSE;
+
typedef struct {
const gchar **input;
const gchar **sorted;
@@ -45,6 +47,12 @@ do_collate (gboolean for_file, gboolean use_key, const CollateTest *test)
Line line;
gint i;
+ if (missing_locale)
+ {
+ g_test_skip ("no en_US locale");
+ return;
+ }
+
line_array = g_array_new (FALSE, FALSE, sizeof(Line));
g_array_set_clear_func (line_array, (GDestroyNotify)clear_line);
@@ -253,8 +261,10 @@ main (int argc, char *argv[])
locale = setlocale (LC_ALL, "");
if (locale == NULL || strcmp (locale, "en_US") != 0)
{
- g_test_message ("No suitable locale, skipping test");
- return 0;
+ g_test_message ("No suitable locale, skipping tests");
+ missing_locale = TRUE;
+ /* let the tests run to completion so they show up as SKIP'd in TAP
+ * output */
}
test[0].input = input0;