<commit_before># -*- mode: ruby; -*-

desc "Run the default test suite (Ruby)"
task :test => 'test:ruby'

namespace :test do
  DEFAULT_TESTS = ['functional', 'unit', 'bson', 'threading']
  ENV['TEST_MODE'] = 'TRUE'

  desc "Run default test suites with the BSON C-extension enabled."
  task :c do
    ENV['C_EXT'] = 'TRUE'
    Rake::Task['compile:cbson'].invoke
    Rake::Task['test:ruby'].invoke
    ENV['C_EXT'] = nil
  end

  desc "Runs default test suites"
  task :ruby do
    if RUBY_VERSION >= "1.9.0" && RUBY_ENGINE == 'ruby'
      require 'simplecov'
      SimpleCov.start do
        add_group "Mongo", 'lib/mongo'
        add_group "BSON", 'lib/bson'
        add_filter "/test/"
      end
    end

    if ENV['TEST']
      Rake::Task['test:functional'].invoke
    else
      DEFAULT_TESTS.each { |t| Rake::Task["test:#{t}"].invoke }
    end
    Rake::Task['test:cleanup'].invoke
  end

  %w(sharded_cluster unit threading auxillary bson tools).each do |suite|
    Rake::TestTask.new(suite.to_sym) do |t|
      t.test_files = FileList["test/#{suite}/*_test.rb"]
      t.libs << 'test'
    end
  end

  Rake::TestTask.new(:replica_set) do |t|
    t.test_files = FileList['test/replica_set/*_test.rb'] - ['test/replica_set/count_test.rb']
    t.libs << 'test'
  end
<commit_msg>minor: only run simplecov for COVERAGE environment<commit_after># -*- mode: ruby; -*-

desc "Run the default test suite (Ruby)"
task :test => 'test:ruby'

namespace :test do
  DEFAULT_TESTS = ['functional', 'unit', 'bson', 'threading']
  ENV['TEST_MODE'] = 'TRUE'

  desc "Run default test suites with the BSON C-extension enabled."
  task :c do
    ENV['C_EXT'] = 'TRUE'
    Rake::Task['compile:cbson'].invoke
    Rake::Task['test:ruby'].invoke
    ENV['C_EXT'] = nil
  end

  desc "Runs default test suites"
  task :ruby do
    if RUBY_VERSION >= "1.9.0" && RUBY_ENGINE == 'ruby'
      if ENV['COVERAGE']
        require 'simplecov'
        SimpleCov.start do
          add_group "Mongo", 'lib/mongo'
          add_group "BSON", 'lib/bson'
          add_filter "/test/"
        end
      end
    end

    if ENV['TEST']
      Rake::Task['test:functional'].invoke
    else
      DEFAULT_TESTS.each { |t| Rake::Task["test:#{t}"].invoke }
    end
    Rake::Task['test:cleanup'].invoke
  end

  %w(sharded_cluster unit threading auxillary bson tools).each do |suite|
    Rake::TestTask.new(suite.to_sym) do |t|
      t.test_files = FileList["test/#{suite}/*_test.rb"]
      t.libs << 'test'
    end
  end

  Rake::TestTask.new(:replica_set) do |t|
    t.test_files = FileList['test/replica_set/*_test.rb'] - ['test/replica_set/count_test.rb']
    t.libs << 'test'
  end

{'fraction_non_alphanumeric': 0.16025641025641027, 'fraction_numerical': 0.0022624434389140274, 'mean_word_length': 3.0196969696969695, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, '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': '1025358', 'n_tokens_mistral': 1005, 'n_tokens_neox': 959, 'n_words': 221}