File: ruby-tests.rb

package info (click to toggle)
ruby-rspec 3.8.0c0e1m0s0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 6,640 kB
  • sloc: ruby: 65,844; sh: 807; makefile: 99
file content (38 lines) | stat: -rw-r--r-- 962 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
require "yaml"

# We are going to chdir in the so we need absolute paths for the libs
$:.collect! { |p| p.start_with?('debian/') ? File.expand_path(p) : p }

libs = []

%w{rspec spec-core rspec-expectations rspec-mocks rspec-support}.each do |x|
  libs << File.expand_path("debian/ruby-#{x}/usr/lib/ruby/vendor_ruby")
end

LIBS = %w{rspec-core rspec-expectations rspec-mocks rspec-support}

EXC_TESTS = [
  # require 'syntax' gem
  'spec/rspec/core/formatters/text_mate_formatter_spec.rb',
  'spec/rspec/core/formatters/html_formatter_spec.rb',
]

success=true

LIBS.each do |lib|
  fork do
    Dir.chdir(lib) do
      require "rspec/core"

      RSpec.configure do |c|
        c.libs= libs
      end
      exit(RSpec::Core::Runner.run( Dir["spec/rspec/**/*_spec.rb"] - EXC_TESTS + ["-I#{libs.join(':')}"], $stderr, $stdout))
    end
  end
  Process.wait
  #exit($?.exitstatus) if $?.exitstatus != 0
  success &= ($?.exitstatus == 0)
end

exit(1) unless success