<commit_before>#include <stdlib.h>
#include <unistd.h>
#include <locale.h>
#include <libintl.h>
#include <gio.h>
#include <gstdio.h>

typedef struct {
  const gchar *name;
  const gchar *opt;
  const gchar *stderr;
} SchemaTest;

static void
test_schema (gpointer data)
{
  SchemaTest *test = (SchemaTest *) data;

  if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR))
    {
      gchar *filename = g_strconcat (test->name, ".gschema.xml", NULL);
      gchar *path = g_build_filename (SRCDIR, "schema-tests", filename, NULL);
      gchar *argv[] = {
        "../gschema-compile",
        "--dry-run",
        "--one-schema-file", path,
        (gchar *)test->opt,
        NULL
      };
      gchar *envp[] = { NULL };
      execve (argv[0], argv, envp);
      g_free (filename);
      g_free (path);
    }
  if (test->stderr)
    {
      g_test_trap_assert_failed ();
      g_test_trap_assert_stderr (test->stderr);
    }
  else
    g_test_trap_assert_passed();<commit_msg>Fix gschema-compile tests for --schema-files changes<commit_after>#include <stdlib.h>
#include <unistd.h>
#include <locale.h>
#include <libintl.h>
#include <gio.h>
#include <gstdio.h>

typedef struct {
  const gchar *name;
  const gchar *opt;
  const gchar *stderr;
} SchemaTest;

static void
test_schema (gpointer data)
{
  SchemaTest *test = (SchemaTest *) data;

  if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR))
    {
      gchar *filename = g_strconcat (test->name, ".gschema.xml", NULL);
      gchar *path = g_build_filename (SRCDIR, "schema-tests", filename, NULL);
      gchar *argv[] = {
        "../gschema-compile",
        "--dry-run",
        "--schema-files", path,
        (gchar *)test->opt,
        NULL
      };
      gchar *envp[] = { NULL };
      execve (argv[0], argv, envp);
      g_free (filename);
      g_free (path);
    }
  if (test->stderr)
    {
      g_test_trap_assert_failed ();
      g_test_trap_assert_stderr (test->stderr);
    }
  else
    g_test_trap_assert_passed();
{'fraction_non_alphanumeric': 0.14954682779456194, 'fraction_numerical': 0.002014098690835851, 'mean_word_length': 2.8285163776493256, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '635599', 'n_tokens_mistral': 746, 'n_tokens_neox': 731, 'n_words': 158}