Hopefully fix CI by improving multi-suite runner.

This commit is contained in:
Tristan Hume
2013-08-16 15:15:15 -04:00
parent 6cde98319f
commit eb68a751ac
2 changed files with 10 additions and 17 deletions

View File

@@ -7,14 +7,8 @@ require 'rubygems/package_task'
task :default => 'test'
Rake::TestTask.new(:lax_test) do |t|
t.libs << '.' << 'lib' << 'test'
t.test_files = FileList['test/liquid/**/*_test.rb']
t.options = 'lax'
t.verbose = false
end
Rake::TestTask.new(:strict_test) do |t|
desc 'run test suite with default parser'
Rake::TestTask.new(:base_test) do |t|
t.libs << '.' << 'lib' << 'test'
t.test_files = FileList['test/liquid/**/*_test.rb']
t.verbose = false
@@ -22,8 +16,11 @@ end
desc 'runs test suite with both strict and lax parsers'
task :test do
Rake::Task['lax_test'].invoke
Rake::Task['strict_test'].invoke
ENV['LIQUID_PARSER_MODE'] = 'lax'
Rake::Task['base_test'].invoke
ENV['LIQUID_PARSER_MODE'] = 'strict'
Rake::Task['base_test'].reenable
Rake::Task['base_test'].invoke
end
gemspec = eval(File.read('liquid.gemspec'))

View File

@@ -10,13 +10,9 @@ end
require File.join(File.dirname(__FILE__), '..', 'lib', 'liquid')
mode = :strict
if ARGV.last == 'lax'
puts "-- LAX ERROR MODE"
ARGV.pop
ARGV.compact! # because things break on Rubinius otherwise
mode = :lax
else
puts "-- STRICT ERROR MODE"
if env_mode = ENV['LIQUID_PARSER_MODE']
puts "-- #{env_mode.upcase} ERROR MODE"
mode = env_mode.to_sym
end
Liquid::Template.error_mode = mode