mirror of https://github.com/KLayout/klayout.git
Compatibility with ruby 1.8, force garbage cleanup for LVS/DRC and tests.
This commit is contained in:
parent
6e6e449eef
commit
df7195b81f
|
|
@ -1,5 +1,7 @@
|
|||
# $autorun-early
|
||||
|
||||
require 'pathname'
|
||||
|
||||
module DRC
|
||||
|
||||
# The DRC engine
|
||||
|
|
@ -1335,6 +1337,8 @@ CODE
|
|||
|
||||
def _finish(final = true)
|
||||
|
||||
begin
|
||||
|
||||
_flush
|
||||
|
||||
view = RBA::LayoutView::current
|
||||
|
|
@ -1435,6 +1439,8 @@ CODE
|
|||
|
||||
end
|
||||
|
||||
ensure
|
||||
|
||||
@output_layout = nil
|
||||
@output_layout_file = nil
|
||||
@output_cell = nil
|
||||
|
|
@ -1457,6 +1463,11 @@ CODE
|
|||
@log_file = nil
|
||||
end
|
||||
|
||||
# force garbage collection
|
||||
GC.start
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def _take_data
|
||||
|
|
@ -1498,7 +1509,11 @@ CODE
|
|||
# resolves the file path relative to the source's path
|
||||
sp = self.source.path
|
||||
if sp
|
||||
if File.respond_to?(:absolute_path)
|
||||
return File::absolute_path(file, File::dirname(sp))
|
||||
else
|
||||
return (Pathname::new(File::dirname(sp)) + Pathname.new(file)).to_s
|
||||
end
|
||||
else
|
||||
return file
|
||||
end
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ module DRC
|
|||
|
||||
ensure
|
||||
|
||||
# cleans up and creates layout views
|
||||
# cleans up and creates layout and report views
|
||||
_drc._finish
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ module LVS
|
|||
|
||||
ensure
|
||||
|
||||
# cleans up and creates layout views
|
||||
# cleans up and creates layout and report views
|
||||
_lvs._finish
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
# environment is shut down. Therefore we must release all RBA objects by explicitly calling the GC
|
||||
# and start the test suite manually.
|
||||
|
||||
begin
|
||||
|
||||
err = 0
|
||||
any = nil
|
||||
repeat = (ENV["TESTREPEAT"] || "1").to_i
|
||||
|
|
@ -34,3 +36,7 @@ if err > 0
|
|||
raise("Tests failed (#{err} Errors + Failures)")
|
||||
end
|
||||
|
||||
ensure
|
||||
GC.start
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -35,3 +35,6 @@ Object.constants.each do |c|
|
|||
end
|
||||
end
|
||||
|
||||
# Some cleanup ahead
|
||||
GC.start
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue