File: test_prologue.rb

package info (click to toggle)
klayout 0.30.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 292,204 kB
  • sloc: cpp: 2,068,428; ruby: 47,823; xml: 26,924; python: 14,404; sh: 1,812; tcl: 212; perl: 170; makefile: 112; ansic: 42
file content (40 lines) | stat: -rw-r--r-- 1,015 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

# 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

# Some cleanup ahead
GC.start