From 00b57884506e8ea295dc4831b35c2cada8b703a8 Mon Sep 17 00:00:00 2001 From: Nathan Broadbent Date: Thu, 23 Aug 2012 11:10:13 +1200 Subject: [PATCH] Use test.sh script to run tests, because Ruby processes run really slow when started from a Rake task --- .travis.yml | 1 + Rakefile | 15 --------------- test.sh | 19 +++++++++++++++++++ 3 files changed, 20 insertions(+), 15 deletions(-) delete mode 100644 Rakefile create mode 100755 test.sh diff --git a/.travis.yml b/.travis.yml index 748adee..64ef4bf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,2 +1,3 @@ +script: ./test.sh before_script: - sudo apt-get install zsh diff --git a/Rakefile b/Rakefile deleted file mode 100644 index 6fb0e8b..0000000 --- a/Rakefile +++ /dev/null @@ -1,15 +0,0 @@ -require 'rake' - -desc "Run shUnit2 tests" -task :test do - Dir.glob("test/**/*_test.sh").each do |test| - ["bash", "zsh"].each do |shell| - puts "== Running tests with [#{shell}]: #{test}" - @failed = !system("#{shell} #{test}") || @failed - end - end - exit @failed ? 1 : 0 -end - -task :default => ['test'] - diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..fff4438 --- /dev/null +++ b/test.sh @@ -0,0 +1,19 @@ +#!/bin/sh +# Run SCM Breeze shUnit2 tests + +failed=false + +for test in $(find test/lib -name *_test.sh); do + for shell in bash zsh; do + echo "== Running tests with [$shell]: $test" + $shell $test || failed=true + done +done + +if [ "$failed" = "true" ]; then + echo "Tests failed!" + return 1; +else + echo "All tests passed!" + return 0; +fi \ No newline at end of file