mirror of
https://github.com/KLayout/klayout.git
synced 2026-09-05 00:53:00 +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
37 lines
815 B
Ruby
37 lines
815 B
Ruby
|
|
# In the test environment, we cannot make sure that we destroy the ruby interpreter before the RBA
|
|
# environment is shut down. Therefore we must release all RBA objects by explicitly calling the GC
|
|
# and start the test suite manually.
|
|
|
|
err = 0
|
|
any = nil
|
|
repeat = (ENV["TESTREPEAT"] || "1").to_i
|
|
|
|
class MyTestRunner < Test::Unit::UI::Console::TestRunner
|
|
def initialize(suite, *args)
|
|
super(suite, *args)
|
|
end
|
|
def test_started(name)
|
|
super
|
|
end
|
|
end
|
|
|
|
Object.constants.each do |c|
|
|
if c.to_s =~ /_TestClass$/
|
|
repeat.times do
|
|
r = MyTestRunner::new(Object.const_get(c)).start
|
|
err += r.error_count + r.failure_count
|
|
end
|
|
any = true
|
|
end
|
|
end
|
|
|
|
if !any
|
|
raise("No test class defined (any ending with _TestClass)")
|
|
end
|
|
|
|
if err > 0
|
|
raise("Tests failed (#{err} Errors + Failures)")
|
|
end
|
|
|