mirror of
https://github.com/KLayout/klayout.git
synced 2026-09-03 16:30:20 +02:00
This commit also contains some important fixes: * Option -wd wasn't working * Relative layout file paths in session files are resolved as relative to the session file. On writing, absolute paths are used, so this change only affects session files build intentionally. Plus: * Program version is available in unit tests too * Fixed a typo in the RBA::Expression documentation
38 lines
984 B
Ruby
38 lines
984 B
Ruby
|
|
# in MSVC environment:
|
|
if ENV["RUBY"]
|
|
ruby_libs = "#{ENV["RUBY"]}/lib/ruby/#{RUBY_VERSION}"
|
|
if !$:.member?(ruby_libs)
|
|
$:.push(ruby_libs)
|
|
end
|
|
end
|
|
|
|
# Set this to true to disable some tests involving exceptions
|
|
$leak_check = ENV["TEST_LEAK_CHECK"]
|
|
|
|
# Fetch location of source files and the temp files
|
|
$ut_testsrc = ENV["TESTSRC"] || raise("Environment variable $TESTSRC not set")
|
|
$ut_testtmp = ENV["TESTTMP_WITH_NAME"] || ENV["TESTTMP"] || raise("Environment variable $TESTTMP not set")
|
|
|
|
# Pull packages from vendor drop-in
|
|
vendor = File.join($ut_testsrc, "testdata", "vendor", "ruby")
|
|
if !$:.member?(vendor)
|
|
$:.unshift(vendor)
|
|
end
|
|
|
|
# Require Test::Unit
|
|
require 'test/unit/ui/console/testrunner'
|
|
|
|
# TestBase is an alias for "TestCase"
|
|
Object.const_defined?(:TestBase) && Object.send(:remove_const, :TestBase)
|
|
TestBase = Test::Unit::TestCase
|
|
|
|
# undefine existing classes
|
|
|
|
Object.constants.each do |c|
|
|
if c.to_s =~ /_TestClass$/
|
|
Object.send(:remove_const, c)
|
|
end
|
|
end
|
|
|