<commit_before>#include "config.h"

#include <cogl/cogl.h>

#include <glib.h>
#include <locale.h>
#include <stdlib.h>
#include <string.h>

#include "test-utils.h"

static TestUtilsSharedState *shared_state = NULL;

/* A bit of sugar for adding new conformance tests */
#define ADD_TEST(FUNC, REQUIREMENTS)  G_STMT_START {      \
  extern void FUNC (TestUtilsGTestFixture *, void *);     \
  if (strcmp (#FUNC, argv[1]) == 0)                       \
    {                                                     \
      test_utils_init (shared_state, REQUIREMENTS);       \
      FUNC (NULL, shared_state);                          \
      test_utils_fini (shared_state);                     \
      exit (0);                                           \
    }                                                     \
} G_STMT_END

#define UNPORTED_TEST(FUNC)

int
main (int argc, char **argv)
{
  int i;

  if (argc != 2)
    {
      g_printerr ("usage %s UNIT_TEST\n", argv[0]);
      exit (1);
    }

  /* Just for convenience in case people try passing the wrapper
   * filenames for the UNIT_TEST argument we normalize '-' characters
   * to '_' characters... */
  for (i = 0; argv[1][i]; i++)
    {
      if (argv[1][i] == '-')
        argv[1][i] = '_';
    }

  /* Initialise the state you need to share with everything.
   */
  shared_state = g_new0 (TestUtilsSharedState, 1);
  shared_state->argc_addr = &argc;
  shared_state->argv_addr = &argv;

  /* This file is run through a sed script during the make step so the
   * lines containing the tests need to be formatted on a single line
   * each.
   */

  UNPORTED_TEST (test_cogl_object);
  UNPORTED_TEST (test_cogl_fixed);
  UNPORTED_TEST (test_cogl_materials);
  ADD_TEST (test_cogl_pipeline_user_matrix, 0);
  ADD_TEST (test_cogl_blend_strings, 0);
  UNPORTED_TEST (test_cogl_premult);
  UNPORTED_TEST (test_cogl_readpixels);
  ADD_TEST (test_cogl_path, 0);
  ADD_TEST (test_cogl_depth_test, 0);
  ADD_TEST (test_cogl_color_mask, 0);
  ADD_TEST (test_cogl_backface_culling, TEST_REQUIREMENT_NPOT);

  ADD_TEST (test_cogl_sparse_pipeline, 0);

  UNPORTED_TEST (test_cogl_npot_texture);
  UNPORTED_TEST (test_cogl_multitexture);
  UNPORTED_TEST (test_cogl_texture_mipmaps);
  ADD_TEST (test_cogl_sub_texture, TEST_REQUIREMENT_GL);<commit_msg>test: remove FEATURE_GL requirement for sub_texture test<commit_after>#include "config.h"

#include <cogl/cogl.h>

#include <glib.h>
#include <locale.h>
#include <stdlib.h>
#include <string.h>

#include "test-utils.h"

static TestUtilsSharedState *shared_state = NULL;

/* A bit of sugar for adding new conformance tests */
#define ADD_TEST(FUNC, REQUIREMENTS)  G_STMT_START {      \
  extern void FUNC (TestUtilsGTestFixture *, void *);     \
  if (strcmp (#FUNC, argv[1]) == 0)                       \
    {                                                     \
      test_utils_init (shared_state, REQUIREMENTS);       \
      FUNC (NULL, shared_state);                          \
      test_utils_fini (shared_state);                     \
      exit (0);                                           \
    }                                                     \
} G_STMT_END

#define UNPORTED_TEST(FUNC)

int
main (int argc, char **argv)
{
  int i;

  if (argc != 2)
    {
      g_printerr ("usage %s UNIT_TEST\n", argv[0]);
      exit (1);
    }

  /* Just for convenience in case people try passing the wrapper
   * filenames for the UNIT_TEST argument we normalize '-' characters
   * to '_' characters... */
  for (i = 0; argv[1][i]; i++)
    {
      if (argv[1][i] == '-')
        argv[1][i] = '_';
    }

  /* Initialise the state you need to share with everything.
   */
  shared_state = g_new0 (TestUtilsSharedState, 1);
  shared_state->argc_addr = &argc;
  shared_state->argv_addr = &argv;

  /* This file is run through a sed script during the make step so the
   * lines containing the tests need to be formatted on a single line
   * each.
   */

  UNPORTED_TEST (test_cogl_object);
  UNPORTED_TEST (test_cogl_fixed);
  UNPORTED_TEST (test_cogl_materials);
  ADD_TEST (test_cogl_pipeline_user_matrix, 0);
  ADD_TEST (test_cogl_blend_strings, 0);
  UNPORTED_TEST (test_cogl_premult);
  UNPORTED_TEST (test_cogl_readpixels);
  ADD_TEST (test_cogl_path, 0);
  ADD_TEST (test_cogl_depth_test, 0);
  ADD_TEST (test_cogl_color_mask, 0);
  ADD_TEST (test_cogl_backface_culling, TEST_REQUIREMENT_NPOT);

  ADD_TEST (test_cogl_sparse_pipeline, 0);

  UNPORTED_TEST (test_cogl_npot_texture);
  UNPORTED_TEST (test_cogl_multitexture);
  UNPORTED_TEST (test_cogl_texture_mipmaps);
  ADD_TEST (test_cogl_sub_texture, 0);
{'fraction_non_alphanumeric': 0.10634611219406541, 'fraction_numerical': 0.008013861815031406, 'mean_word_length': 2.517136329017517, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7568827', 'n_tokens_mistral': 1660, 'n_tokens_neox': 1575, 'n_words': 373}