"Fossies" - the Fresh Open Source Software Archive

Member "asciidoctor-2.0.10/tasks/test.rake" (1 Jun 2019, 842 Bytes) of package /linux/www/asciidoctor-2.0.10.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Ruby source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "test.rake": 2.0.7_vs_2.0.8.

    1 # frozen_string_literal: true
    2 def prepare_test_env
    3   # rather than hardcoding gc settings in test task,
    4   # could use https://gist.github.com/benders/788695
    5   ENV['RUBY_GC_MALLOC_LIMIT'] = 128_000_000.to_s
    6   ENV['RUBY_GC_OLDMALLOC_LIMIT'] = 128_000_000.to_s
    7   ENV['RUBY_GC_HEAP_INIT_SLOTS'] = 750_000.to_s
    8   ENV['RUBY_GC_HEAP_FREE_SLOTS'] = 750_000.to_s
    9   ENV['RUBY_GC_HEAP_GROWTH_MAX_SLOTS'] = 50_000.to_s
   10   ENV['RUBY_GC_HEAP_GROWTH_FACTOR'] = 2.to_s
   11 end
   12 
   13 begin
   14   require 'rake/testtask'
   15   Rake::TestTask.new :test do |t|
   16     prepare_test_env
   17     puts %(LANG: #{ENV['LANG']}) if ENV.key? 'TRAVIS_BUILD_ID'
   18     t.libs << 'test'
   19     t.pattern = 'test/**/*_test.rb'
   20     t.verbose = true
   21     t.warning = true
   22   end
   23 rescue LoadError
   24   warn $!.message
   25 end
   26 
   27 namespace :test do
   28   desc 'Run unit and feature tests'
   29   task all: [:test, :features]
   30 end