MCPcopy Create free account
hub / github.com/KLayout/klayout / test_8_file_based_library

Method test_8_file_based_library

testdata/ruby/dbLibrary.rb:268–299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266 end
267
268 def test_8_file_based_library
269
270 # clean up before
271 [ "RBA-unit-test" ].each do |name|
272 l = RBA::Library::library_by_name(name)
273 l && l.unregister
274 end
275
276 lylib = RBA::Layout::new
277 lylib.read(File.join($ut_testsrc, "testdata", "gds", "lib_a.gds"))
278
279 tmp = File::join($ut_testtmp, "rba_dbLibrary_8.gds")
280 lylib.write(tmp)
281
282 lib = RBA::Library::library_from_file(tmp, "RBA-unit-test")
283
284 ly = RBA::Layout::new
285 top = ly.create_cell("TOP")
286 a = ly.create_cell("A", "RBA-unit-test")
287 top.insert(RBA::CellInstArray::new(a, RBA::Trans::new))
288
289 assert_equal(top.dbbox.to_s, "(0,0;2,2)")
290
291 lylib.clear
292 lylib.read(File.join($ut_testsrc, "testdata", "gds", "lib_b.gds"))
293 lylib.write(tmp)
294
295 lib.refresh
296
297 assert_equal(top.dbbox.to_s, "(-1,-1;1,1)")
298
299 end
300
301 def test_9_file_based_library_multiple_files
302

Callers

nothing calls this directly

Calls 10

eachMethod · 0.80
unregisterMethod · 0.45
readMethod · 0.45
joinMethod · 0.45
writeMethod · 0.45
create_cellMethod · 0.45
insertMethod · 0.45
to_sMethod · 0.45
clearMethod · 0.45
refreshMethod · 0.45

Tested by

no test coverage detected