testsuite: Don't exit unsuccessfully when using TAP

The meson TAP parser doesn't take this lightly and
forgets all about xfails when we exit(1), so don't.
This commit is contained in:
Matthias Clasen 2020-03-20 11:43:51 -04:00
parent c893f79023
commit dc4b7131f1

View File

@ -57,11 +57,14 @@ static const GOptionEntry test_args[] = {
{ NULL }
};
static gboolean using_tap;
static gboolean
parse_command_line (int *argc, char ***argv)
{
GError *error = NULL;
GOptionContext *context;
int i;
context = g_option_context_new ("- run GTK reftests");
g_option_context_add_main_entries (context, test_args, NULL);
@ -73,6 +76,12 @@ parse_command_line (int *argc, char ***argv)
return FALSE;
}
for (i = 0; i < *argc; i++)
{
if (strcmp ((*argv)[i], "--tap") == 0)
using_tap = TRUE;
}
gtk_test_init (argc, argv);
if (g_strcmp0 (arg_direction, "rtl") == 0)
@ -379,6 +388,7 @@ int
main (int argc, char **argv)
{
const char *basedir;
int result;
/* I don't want to fight fuzzy scaling algorithms in GPUs,
* so unless you explicitly set it to something else, we
@ -424,6 +434,11 @@ main (int argc, char **argv)
*/
chdir (basedir);
return g_test_run ();
result = g_test_run ();
if (using_tap)
return 0;
return result;
}