Skip to content

Commit

Permalink
test: add some tracing to the svg validity test
Browse files Browse the repository at this point in the history
It's a bit hard to figure out from the CI logs what failed because they
may be truncated. And for users not intimitely familiar with the test
suite it's not that simple either so let's put in a bunch of trace
stataments that should at least point to where things go wrong.
  • Loading branch information
whot committed May 8, 2024
1 parent 8dc47a3 commit 9cb019e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion test/test-tablet-svg-validity.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
#include <glib.h>
#include "libwacom.h"

#define trace(fmt, ...) \
fprintf(stderr, "%s: checking " fmt "\n", __func__, __VA_ARGS__)

static xmlNodePtr
verify_has_sub (xmlNodePtr cur, char *sub)
{
Expand Down Expand Up @@ -79,12 +82,13 @@ class_found (gchar **classes, gchar *value)
static void
verify_has_class (xmlNodePtr cur, const gchar *expected)
{

xmlChar *prop;
gchar **classes_present;
gchar **classes_expected;
gchar **ptr;

trace("%s", expected);

prop = xmlGetProp (cur, (xmlChar *) "class");
g_assert (prop != NULL);
g_assert (strlen((const char *) prop) > 0);
Expand All @@ -109,6 +113,8 @@ check_button (xmlNodePtr cur, const WacomDevice *device, char button, gchar *typ
xmlNodePtr node;
WacomButtonFlags flags;

trace("%c %s", button, type);

/* Check ID */
sub = g_strdup_printf ("%s%c", type, button);
node = verify_has_sub (cur, sub);
Expand All @@ -132,6 +138,8 @@ check_touchstrip (xmlNodePtr cur, gchar *id)
char *class;
xmlNodePtr node;

trace("%s", id);

node = verify_has_sub (cur, id);
g_assert (node != NULL);

Expand Down Expand Up @@ -234,6 +242,8 @@ check_touchring (xmlNodePtr cur, gchar *id)
char *class;
xmlNodePtr node;

trace("%s", id);

node = verify_has_sub (cur, id);
g_assert (node != NULL);

Expand Down

0 comments on commit 9cb019e

Please sign in to comment.