<commit_before>require 'minitest/spec'
require 'minitest/autorun'
require 'rr'
require 'ffi'

Thread.abort_on_exception = true

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))

require 'gir_ffi'

if RUBY_PLATFORM == 'java'
  require 'java'
  JRuby.objectspace = true
end

# Since the tests will call Gtk+ functions, Gtk+ must be initialized.
GirFFI.setup :Gtk, '2.0'
Gtk.init

GirFFI::IRepository.prepend_search_path File.join(File.dirname(__FILE__), 'lib')
module GirFFI
  class IRepository
    def shared_library_with_regress namespace
      case namespace
      when "Regress"
	return File.join(File.dirname(__FILE__), 'lib', 'libregress.so')
      when "GIMarshallingTests"
	return File.join(File.dirname(__FILE__), 'lib', 'libgimarshallingtests.so')
      else
	return shared_library_without_regress namespace<commit_msg>Ensure minitest/spec is found on JRuby.<commit_after>if RUBY_PLATFORM == 'java'
  require 'java'
  JRuby.objectspace = true
  require 'rubygems'
end

require 'minitest/spec'
require 'minitest/autorun'
require 'rr'
require 'ffi'

Thread.abort_on_exception = true

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))

require 'gir_ffi'

# Since the tests will call Gtk+ functions, Gtk+ must be initialized.
GirFFI.setup :Gtk, '2.0'
Gtk.init

GirFFI::IRepository.prepend_search_path File.join(File.dirname(__FILE__), 'lib')
module GirFFI
  class IRepository
    def shared_library_with_regress namespace
      case namespace
      when "Regress"
	return File.join(File.dirname(__FILE__), 'lib', 'libregress.so')
      when "GIMarshallingTests"
	return File.join(File.dirname(__FILE__), 'lib', 'libgimarshallingtests.so')
      else
	return shared_library_without_regress namespace
{'fraction_non_alphanumeric': 0.11398963730569948, 'fraction_numerical': 0.002302820955670697, 'mean_word_length': 5.207142857142857, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '7445014', 'n_tokens_mistral': 624, 'n_tokens_neox': 616, 'n_words': 136}