diff --git a/.travis.yml b/.travis.yml index 2e3f4fb..e8d35c1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ matrix: allow_failures: - rvm: jruby-head -script: "rake" +script: "bundle exec rake" notifications: disable: true diff --git a/Gemfile b/Gemfile index 5f22d02..73fc3d9 100644 --- a/Gemfile +++ b/Gemfile @@ -7,4 +7,8 @@ group :test do gem 'spy', '0.4.1' gem 'benchmark-ips' gem 'rubocop' + + platform :ruby, :mswin, :mingw do + gem 'liquid-c', github: 'Shopify/liquid-c', ref: '35e9aee48d639ae1d3ac9ba77616aca9800eab7d' + end end diff --git a/Rakefile b/Rakefile index 2e125ba..e3633f5 100755 --- a/Rakefile +++ b/Rakefile @@ -27,9 +27,22 @@ desc 'runs test suite with both strict and lax parsers' task :test do 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 + + if RUBY_ENGINE == 'ruby' + ENV['LIQUID-C'] = '1' + + ENV['LIQUID_PARSER_MODE'] = 'lax' + Rake::Task['base_test'].reenable + Rake::Task['base_test'].invoke + + ENV['LIQUID_PARSER_MODE'] = 'strict' + Rake::Task['base_test'].reenable + Rake::Task['base_test'].invoke + end end task gem: :build diff --git a/test/test_helper.rb b/test/test_helper.rb index 15d8d51..b8e4d9a 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -15,6 +15,11 @@ if env_mode = ENV['LIQUID_PARSER_MODE'] end Liquid::Template.error_mode = mode +if ENV['LIQUID-C'] == '1' + puts "-- LIQUID C" + require 'liquid/c' +end + if Minitest.const_defined?('Test') # We're on Minitest 5+. Nothing to do here. else