From eb68a751ac264d304a0d64781f4234c3c0318b04 Mon Sep 17 00:00:00 2001 From: Tristan Hume Date: Fri, 16 Aug 2013 15:15:15 -0400 Subject: [PATCH] Hopefully fix CI by improving multi-suite runner. --- Rakefile | 17 +++++++---------- test/test_helper.rb | 10 +++------- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/Rakefile b/Rakefile index 40abbfd..d88d8f5 100755 --- a/Rakefile +++ b/Rakefile @@ -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')) diff --git a/test/test_helper.rb b/test/test_helper.rb index 671e042..aaabf15 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -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