Use test.sh script to run tests, because Ruby processes run really slow when started from a Rake task

This commit is contained in:
Nathan Broadbent
2012-08-23 11:10:13 +12:00
parent e75041262e
commit 00b5788450
3 changed files with 20 additions and 15 deletions

View File

@@ -1,2 +1,3 @@
script: ./test.sh
before_script: before_script:
- sudo apt-get install zsh - sudo apt-get install zsh

View File

@@ -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']

19
test.sh Executable file
View File

@@ -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