Эх сурвалжийг харах

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

whitequark 7 жил өмнө
parent
commit
ecf6bf291f
2 өөрчлөгдсөн 16 нэмэгдсэн , 1 устгасан
  1. 15 0
      .test_like_travis.rb
  2. 1 1
      .travis.yml

+ 15 - 0
.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

+ 1 - 1
.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: