summaryrefslogtreecommitdiff
path: root/features/step_definitions/cross_compilation.rb
blob: 51e3cdf85c4fbd175188de4c3700b271954082b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Naive way of looking into platforms, please include others like FreeBSD?
if RUBY_PLATFORM =~ /linux|darwin/
  Given %r{^I'm running a POSIX operating system$} do
  end
end

Given %r{^I've installed cross compile toolchain$} do
  compiler = 'i586-mingw32msvc-gcc'
  found = false
  ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
    next unless File.exist?(File.join(path, compiler))
    found = true
  end
  raise "Cannot locate '#{compiler}' in the PATH." unless found
end

Then /^binaries for platform '(.*)' get generated$/ do |platform|
  ext_for_platform = Dir.glob("tmp/#{platform}/**/*.#{RbConfig::CONFIG['DLEXT']}")
  ext_for_platform.should_not be_empty
end