summaryrefslogtreecommitdiffhomepage
path: root/Rakefile
diff options
context:
space:
mode:
authorAdam Bard <github@adambard.com>2016-11-09 22:21:21 -0800
committerGitHub <noreply@github.com>2016-11-09 22:21:21 -0800
commit5204594edf49ddc5fcba294bb478da8f5e50f227 (patch)
treefcdbadaddac1c7ef6b50c4f7d84a4f3f927ef12f /Rakefile
parent03980b63c7f7fa5bfd6a74e23613bcf82392105a (diff)
parentbb5e514321732ee6fac150cdbfb587cca5c20433 (diff)
Merge pull request #2562 from adambard/upstream
Update rakefile so that it will return an exit code of 1 if there is …
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile36
1 files changed, 20 insertions, 16 deletions
diff --git a/Rakefile b/Rakefile
index b87f1aef..6a31bd72 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,19 +1,23 @@
-task default: %w[test]
-
-task :test do
- failed = false
- Dir["./tests/*.rb"].each do |test_file|
- begin
- ruby test_file
- puts ""
- rescue
- puts "FAILED #{test_file}!"
- puts ""
- failed = true
- end
+task default: %w[encoding yaml return_code]
+$failure = 0
+task :encoding do
+ begin
+ ruby 'tests/encoding.rb'
+ rescue Exception => msg
+ puts msg
+ $failure += 1
end
-
- if failed
- exit 0
+end
+task :yaml do
+ begin
+ ruby 'tests/yaml.rb'
+ rescue Exception => msg
+ puts msg
+ $failure += 1
+ end
+end
+task :return_code do
+ if $failure != 0
+ raise "Failed #{$failure} tests!!"
end
end