Add a script to run every test Travis would run locally.

This commit is contained in:
whitequark 2017-12-22 09:07:46 +00:00
parent 8b6050f711
commit 809cfd5ff2
2 changed files with 16 additions and 1 deletions

15
.test_like_travis.rb Executable file
View File

@ -0,0 +1,15 @@
#!/usr/bin/ruby
require 'yaml'
travis_config = YAML.load_file('.travis.yml')
travis_config['matrix']['include'].each do |env|
ENV['RUSTUP_TOOLCHAIN'] = env['rust']
env['env'].scan(/(\w+)=\'(.+?)\'/) do
ENV[$1] = $2
end
travis_config['script'].each do |cmd|
$stderr.puts('+ #{cmd}'.gsub(/\$(\w+)/) { ENV[$1] })
system(cmd)
end
end

View File

@ -33,7 +33,7 @@ matrix:
- rust: nightly
env: FEATURES='socket-raw socket-udp socket-tcp socket-icmp' MODE='build'
script:
- cargo "$MODE" --no-default-features --features "$FEATURES"
- cargo "$MODE" --no-default-features --features "$FEATURES"
notifications:
irc:
channels: