<commit_before>/* Rapicorn Test
 * Copyright (C) 2007 <NAME>
 *
 * This work is provided "as is"; redistribution and modification
 * in whole or in part, in any medium, physical or electronic is
 * permitted without restriction.
 *
 * This work is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 * In no event shall the authors or contributors be liable for any
 * direct, indirect, incidental, special, exemplary, or consequential
 * damages (including, but not limited to, procurement of substitute
 * goods or services; loss of use, data, or profits; or business
 * interruption) however caused and on any theory of liability, whether
 * in contract, strict liability, or tort (including negligence or
 * otherwise) arising in any way out of the use of this software, even
 * if advised of the possibility of such damage.
 */
#include <rapicorn-core/rapicorntests.h>
#include <rapicorn/rapicorn.hh>
#include <rapicorn/testitems.hh>


/* --- RapicornTester --- */
namespace Rapicorn {
struct RapicornTester {
  static bool
  loops_pending()
  {
    return EventLoop::iterate_loops (false, false);
  }
  static void
  loops_dispatch (bool may_block)
  {
    EventLoop::iterate_loops (may_block, true);
  }
};
} // Rapicorn

namespace {
using namespace Rapicorn;

extern "C" int
main (int   argc,
      char *argv[])
{
  rapicorn_init_test (&argc, &argv);

  /* initialize Rapicorn for X11 backend with application name */
  Application::init_with_x11 (&argc, &argv, "FactoryTest");

  /* find and load GUI definitions relative to argv[0] */
  Application::auto_load ("DummyTranslation",   // i18n_domain,
                          "factory.xml",        // GUI file name
                          argv[0]);
  Root *root;
  Item *item;
  TestContainer *titem;

  TSTART ("Factory Calls");<commit_msg>RAPICORN: load srcdir relative files in factory.cc<commit_after>/* Rapicorn Test
 * Copyright (C) 2007 <NAME>
 *
 * This work is provided "as is"; redistribution and modification
 * in whole or in part, in any medium, physical or electronic is
 * permitted without restriction.
 *
 * This work is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 * In no event shall the authors or contributors be liable for any
 * direct, indirect, incidental, special, exemplary, or consequential
 * damages (including, but not limited to, procurement of substitute
 * goods or services; loss of use, data, or profits; or business
 * interruption) however caused and on any theory of liability, whether
 * in contract, strict liability, or tort (including negligence or
 * otherwise) arising in any way out of the use of this software, even
 * if advised of the possibility of such damage.
 */
#include <rapicorn-core/rapicorntests.h>
#include <rapicorn/rapicorn.hh>
#include <rapicorn/testitems.hh>


/* --- RapicornTester --- */
namespace Rapicorn {
struct RapicornTester {
  static bool
  loops_pending()
  {
    return EventLoop::iterate_loops (false, false);
  }
  static void
  loops_dispatch (bool may_block)
  {
    EventLoop::iterate_loops (may_block, true);
  }
};
} // Rapicorn

namespace {
using namespace Rapicorn;

extern "C" int
main (int   argc,
      char *argv[])
{
  rapicorn_init_test (&argc, &argv);

  /* initialize Rapicorn for X11 backend with application name */
  Application::init_with_x11 (&argc, &argv, "FactoryTest");

  /* find and load GUI definitions relative to argv[0] */
  String factory_xml = Rapicorn::Path::join (SRCDIR, "factory.xml");
  Application::auto_load ("DummyTranslation",   // i18n_domain,
                          factory_xml,          // GUI file name
                          argv[0]);
  Root *root;
  Item *item;
  TestContainer *titem;

  TSTART ("Factory Calls");
{'fraction_non_alphanumeric': 0.09327603640040445, 'fraction_numerical': 0.006066734074823054, 'mean_word_length': 3.5587557603686637, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '2328229', 'n_tokens_mistral': 1155, 'n_tokens_neox': 1084, 'n_words': 446}