File: liquid_test_helper.rb

package info (click to toggle)
ruby-liquid-c 4.2.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 504 kB
  • sloc: ansic: 3,866; ruby: 1,151; makefile: 7
file content (21 lines) | stat: -rw-r--r-- 711 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

# This can be used to setup for running tests from the liquid test suite.
# For example, you could run a single liquid test as follows:
# $ ruby -r./test/liquid_test_helper `bundle info liquid --path`/test/integration/template_test.rb

require "bundler/setup"

liquid_lib_dir = $LOAD_PATH.detect { |p| File.exist?(File.join(p, "liquid.rb")) }
LIQUID_TEST_DIR = File.join(File.dirname(liquid_lib_dir), "test")
$LOAD_PATH << LIQUID_TEST_DIR << File.expand_path("../lib", __dir__)

require "test_helper"
require "liquid/c"

if ENV["LIQUID_C_DISABLE_VM"]
  puts "-- Liquid-C VM Disabled"
  Liquid::ParseContext.liquid_c_nodes_disabled = true
end

GC.stress = true if ENV["GC_STRESS"]