From ecf6bf291f925d0a84d6824c70d852f1a8905fe1 Mon Sep 17 00:00:00 2001 From: whitequark Date: Fri, 22 Dec 2017 09:07:46 +0000 Subject: [PATCH] Add a script to run every test Travis would run locally. --- .test_like_travis.rb | 15 +++++++++++++++ .travis.yml | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100755 .test_like_travis.rb diff --git a/.test_like_travis.rb b/.test_like_travis.rb new file mode 100755 index 00000000..59a367b3 --- /dev/null +++ b/.test_like_travis.rb @@ -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 diff --git a/.travis.yml b/.travis.yml index 1e89c1e0..41d5a7f1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: