mirror of
https://github.com/KLayout/klayout.git
synced 2026-09-03 16:30:20 +02:00
Merge branch 'master' into pymod
This commit is contained in:
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
+27
-23
@@ -30,10 +30,14 @@ load("test_prologue.rb")
|
||||
|
||||
class KLayoutMain_TestClass < TestBase
|
||||
|
||||
def klayout_bin
|
||||
File.join(RBA::Application::instance.inst_path, "klayout")
|
||||
end
|
||||
|
||||
def test_1
|
||||
|
||||
# Basic
|
||||
version = `./klayout -v`
|
||||
version = `#{self.klayout_bin} -v`
|
||||
assert_equal(version, "#{RBA::Application.instance.version}\n")
|
||||
|
||||
end
|
||||
@@ -41,10 +45,10 @@ class KLayoutMain_TestClass < TestBase
|
||||
def test_2
|
||||
|
||||
# Basic Ruby
|
||||
out = `./klayout -b -rd v1=42 -rd v2=hello -r #{File.join(File.dirname(__FILE__), "test.rb")}`
|
||||
out = `#{self.klayout_bin} -b -rd v1=42 -rd v2=hello -r #{File.join(File.dirname(__FILE__), "test.rb")}`
|
||||
assert_equal(out, "Variable v1=42 v2=hello\n")
|
||||
|
||||
out = `./klayout -b -rd v1=42 -rd v2=hello -r #{File.join(File.dirname(__FILE__), "test.rb")} -rm #{File.join(File.dirname(__FILE__), "test2.rb")} -rm #{File.join(File.dirname(__FILE__), "test3.rb")}`
|
||||
out = `#{self.klayout_bin} -b -rd v1=42 -rd v2=hello -r #{File.join(File.dirname(__FILE__), "test.rb")} -rm #{File.join(File.dirname(__FILE__), "test2.rb")} -rm #{File.join(File.dirname(__FILE__), "test3.rb")}`
|
||||
assert_equal(out, "test2\ntest3\nVariable v1=42 v2=hello\n")
|
||||
|
||||
end
|
||||
@@ -52,7 +56,7 @@ class KLayoutMain_TestClass < TestBase
|
||||
def test_3
|
||||
|
||||
# Basic Python
|
||||
out = `./klayout -b -rd v1=42 -rd v2=hello -r #{File.join(File.dirname(__FILE__), "test.py")}`
|
||||
out = `#{self.klayout_bin} -b -rd v1=42 -rd v2=hello -r #{File.join(File.dirname(__FILE__), "test.py")}`
|
||||
assert_equal(out, "Variable v1=42 v2=hello\n")
|
||||
|
||||
end
|
||||
@@ -62,20 +66,20 @@ class KLayoutMain_TestClass < TestBase
|
||||
# Application class
|
||||
if !RBA.constants.find { |x| x == :QDialog || x == "QDialog" }
|
||||
|
||||
out = `./klayout -b -r #{File.join(File.dirname(__FILE__), "test_app.rb")}`
|
||||
out = `#{self.klayout_bin} -b -r #{File.join(File.dirname(__FILE__), "test_app.rb")}`
|
||||
assert_equal(out, "RBA::Application superclass Object\nMainWindow is not there\n")
|
||||
|
||||
out = `./klayout -z -nc -rx -r #{File.join(File.dirname(__FILE__), "test_app.rb")}`
|
||||
out = `#{self.klayout_bin} -z -nc -rx -r #{File.join(File.dirname(__FILE__), "test_app.rb")}`
|
||||
assert_equal(out, "RBA::Application superclass Object\nMainWindow is there\n")
|
||||
|
||||
else
|
||||
|
||||
# QCoreApplication for (headless) mode
|
||||
out = `./klayout -b -r #{File.join(File.dirname(__FILE__), "test_app.rb")}`
|
||||
out = `#{self.klayout_bin} -b -r #{File.join(File.dirname(__FILE__), "test_app.rb")}`
|
||||
assert_equal(out, "RBA::Application superclass RBA::QCoreApplication_Native\nMainWindow is not there\n")
|
||||
|
||||
# QApplication for GUI mode
|
||||
out = `./klayout -z -nc -rx -r #{File.join(File.dirname(__FILE__), "test_app.rb")}`
|
||||
out = `#{self.klayout_bin} -z -nc -rx -r #{File.join(File.dirname(__FILE__), "test_app.rb")}`
|
||||
assert_equal(out, "RBA::Application superclass RBA::QApplication_Native\nMainWindow is there\n")
|
||||
|
||||
end
|
||||
@@ -85,7 +89,7 @@ class KLayoutMain_TestClass < TestBase
|
||||
def test_5
|
||||
|
||||
# Script variables
|
||||
out = `./klayout -b -wd tv1=17 -wd tv2=25 -wd tv3 -r #{File.join(File.dirname(__FILE__), "test_script.rb")}`
|
||||
out = `#{self.klayout_bin} -b -wd tv1=17 -wd tv2=25 -wd tv3 -r #{File.join(File.dirname(__FILE__), "test_script.rb")}`
|
||||
assert_equal(out, "42\ntrue\n")
|
||||
|
||||
end
|
||||
@@ -93,10 +97,10 @@ class KLayoutMain_TestClass < TestBase
|
||||
def test_6
|
||||
|
||||
# Editable / Non-editable mode
|
||||
out = `./klayout -b -ne -r #{File.join(File.dirname(__FILE__), "test_em.rb")}`
|
||||
out = `#{self.klayout_bin} -b -ne -r #{File.join(File.dirname(__FILE__), "test_em.rb")}`
|
||||
assert_equal(out, "false\n")
|
||||
|
||||
out = `./klayout -b -e -r #{File.join(File.dirname(__FILE__), "test_em.rb")}`
|
||||
out = `#{self.klayout_bin} -b -e -r #{File.join(File.dirname(__FILE__), "test_em.rb")}`
|
||||
assert_equal(out, "true\n")
|
||||
|
||||
end
|
||||
@@ -107,27 +111,27 @@ class KLayoutMain_TestClass < TestBase
|
||||
File.open(cfg_file, "w") { |file| file.puts("<config/>") }
|
||||
|
||||
# Special configuration file
|
||||
`./klayout -b -c #{cfg_file} -r #{File.join(File.dirname(__FILE__), "test_set_config1.rb")}`
|
||||
`#{self.klayout_bin} -b -c #{cfg_file} -r #{File.join(File.dirname(__FILE__), "test_set_config1.rb")}`
|
||||
|
||||
out = `./klayout -b -c #{cfg_file} -r #{File.join(File.dirname(__FILE__), "test_read_config.rb")}`
|
||||
out = `#{self.klayout_bin} -b -c #{cfg_file} -r #{File.join(File.dirname(__FILE__), "test_read_config.rb")}`
|
||||
assert_equal(out, "42\n")
|
||||
|
||||
# Update
|
||||
`./klayout -b -c #{cfg_file} -r #{File.join(File.dirname(__FILE__), "test_set_config2.rb")}`
|
||||
`#{self.klayout_bin} -b -c #{cfg_file} -r #{File.join(File.dirname(__FILE__), "test_set_config2.rb")}`
|
||||
|
||||
out = `./klayout -b -c #{cfg_file} -r #{File.join(File.dirname(__FILE__), "test_read_config.rb")}`
|
||||
out = `#{self.klayout_bin} -b -c #{cfg_file} -r #{File.join(File.dirname(__FILE__), "test_read_config.rb")}`
|
||||
assert_equal(out, "17\n")
|
||||
|
||||
# Reset
|
||||
`./klayout -b -c #{cfg_file} -r #{File.join(File.dirname(__FILE__), "test_set_config1.rb")}`
|
||||
`#{self.klayout_bin} -b -c #{cfg_file} -r #{File.join(File.dirname(__FILE__), "test_set_config1.rb")}`
|
||||
|
||||
out = `./klayout -b -c #{cfg_file} -r #{File.join(File.dirname(__FILE__), "test_read_config.rb")}`
|
||||
out = `#{self.klayout_bin} -b -c #{cfg_file} -r #{File.join(File.dirname(__FILE__), "test_read_config.rb")}`
|
||||
assert_equal(out, "42\n")
|
||||
|
||||
# No update
|
||||
`./klayout -b -t -c #{cfg_file} -r #{File.join(File.dirname(__FILE__), "test_set_config2.rb")}`
|
||||
`#{self.klayout_bin} -b -t -c #{cfg_file} -r #{File.join(File.dirname(__FILE__), "test_set_config2.rb")}`
|
||||
|
||||
out = `./klayout -b -c #{cfg_file} -r #{File.join(File.dirname(__FILE__), "test_read_config.rb")}`
|
||||
out = `#{self.klayout_bin} -b -c #{cfg_file} -r #{File.join(File.dirname(__FILE__), "test_read_config.rb")}`
|
||||
assert_equal(out, "42\n")
|
||||
|
||||
end
|
||||
@@ -135,13 +139,13 @@ class KLayoutMain_TestClass < TestBase
|
||||
def test_8
|
||||
|
||||
# Loading layouts
|
||||
out = `./klayout -z -nc -rx #{File.join(File.dirname(__FILE__), "test1.gds")} -r #{File.join(File.dirname(__FILE__), "test_lay.rb")}`
|
||||
out = `#{self.klayout_bin} -z -nc -rx #{File.join(File.dirname(__FILE__), "test1.gds")} -r #{File.join(File.dirname(__FILE__), "test_lay.rb")}`
|
||||
assert_equal(out, "TOP1\n")
|
||||
|
||||
out = `./klayout -z -nc -rx #{File.join(File.dirname(__FILE__), "test1.gds")} #{File.join(File.dirname(__FILE__), "test2.gds")} -r #{File.join(File.dirname(__FILE__), "test_lay2.rb")}`
|
||||
out = `#{self.klayout_bin} -z -nc -rx #{File.join(File.dirname(__FILE__), "test1.gds")} #{File.join(File.dirname(__FILE__), "test2.gds")} -r #{File.join(File.dirname(__FILE__), "test_lay2.rb")}`
|
||||
assert_equal(out, "TOP1\nTOP2\n")
|
||||
|
||||
out = `./klayout -z -nc -rx #{File.join(File.dirname(__FILE__), "test1.gds")} #{File.join(File.dirname(__FILE__), "test2.gds")} -s -r #{File.join(File.dirname(__FILE__), "test_lay2.rb")}`
|
||||
out = `#{self.klayout_bin} -z -nc -rx #{File.join(File.dirname(__FILE__), "test1.gds")} #{File.join(File.dirname(__FILE__), "test2.gds")} -s -r #{File.join(File.dirname(__FILE__), "test_lay2.rb")}`
|
||||
assert_equal(out, "TOP1;TOP2\n")
|
||||
|
||||
end
|
||||
@@ -149,7 +153,7 @@ class KLayoutMain_TestClass < TestBase
|
||||
def test_9
|
||||
|
||||
# Sessions
|
||||
out = `./klayout -z -nc -rx -u #{File.join(File.dirname(__FILE__), "session.lys")} -r #{File.join(File.dirname(__FILE__), "test_lay2.rb")}`
|
||||
out = `#{self.klayout_bin} -z -nc -rx -u #{File.join(File.dirname(__FILE__), "session.lys")} -r #{File.join(File.dirname(__FILE__), "test_lay2.rb")}`
|
||||
assert_equal(out, "TOP2;TOP1\n")
|
||||
|
||||
end
|
||||
|
||||
Vendored
BIN
Binary file not shown.
Vendored
+11
@@ -340,6 +340,17 @@ class DBLayout_TestClass < TestBase
|
||||
i1copy.region = RBA::Box.new(0, 0, 100, 101)
|
||||
assert_equal(i1copy.region.to_s, "(0,0;100,101)")
|
||||
assert_equal(collect(i1copy, l), "[c0](0,100;1000,1200)/[c1](0,100;1000,1200)");
|
||||
i1copy.region = RBA::Region::new(RBA::Box.new(0, 0, 100, 101))
|
||||
assert_equal(i1copy.region.to_s, "(0,0;100,101)")
|
||||
assert_equal(collect(i1copy, l), "[c0](0,100;1000,1200)/[c1](0,100;1000,1200)");
|
||||
i1copy.region = RBA::Box.new(-1000, -1000, 1100, 1101)
|
||||
i1copy.confine_region(RBA::Box.new(0, 0, 100, 101))
|
||||
assert_equal(i1copy.region.to_s, "(0,0;100,101)")
|
||||
assert_equal(collect(i1copy, l), "[c0](0,100;1000,1200)/[c1](0,100;1000,1200)");
|
||||
i1copy.region = RBA::Box.new(-1000, -1000, 1100, 1101)
|
||||
i1copy.confine_region(RBA::Region::new(RBA::Box.new(0, 0, 100, 101)))
|
||||
assert_equal(i1copy.region.to_s, "(0,0;100,101)")
|
||||
assert_equal(collect(i1copy, l), "[c0](0,100;1000,1200)/[c1](0,100;1000,1200)");
|
||||
i1o = l.begin_shapes_overlapping(c0.cell_index, 0, RBA::Box.new(0, 0, 101, 101));
|
||||
assert_equal(collect(i1o, l), "[c0](0,100;1000,1200)/[c1](0,100;1000,1200)/[c2](100,0;1100,1100)");
|
||||
i1o = c0.begin_shapes_rec_overlapping(0, RBA::Box.new(0, 0, 101, 101));
|
||||
|
||||
Vendored
+17
@@ -1361,6 +1361,23 @@ class DBShapes_TestClass < TestBase
|
||||
|
||||
end
|
||||
|
||||
# issue 152 (number of shapes count wrong in viewer mode)
|
||||
def test_10
|
||||
|
||||
ly = RBA::Layout::new(true)
|
||||
ly.read(File.join($ut_testsrc, "testdata", "oasis", "issue_152.oas"))
|
||||
assert_equal(ly.top_cell.shapes(ly.layer(1, 0)).size, 200)
|
||||
ly.top_cell.shapes(ly.layer(1, 0)).insert(RBA::Polygon::new(RBA::Box::new(0, 0, 100, 100)))
|
||||
assert_equal(ly.top_cell.shapes(ly.layer(1, 0)).size, 201)
|
||||
|
||||
ly = RBA::Layout::new(false)
|
||||
ly.read(File.join($ut_testsrc, "testdata", "oasis", "issue_152.oas"))
|
||||
assert_equal(ly.top_cell.shapes(ly.layer(1, 0)).size, 200)
|
||||
ly.top_cell.shapes(ly.layer(1, 0)).insert(RBA::Polygon::new(RBA::Box::new(0, 0, 100, 100)))
|
||||
assert_equal(ly.top_cell.shapes(ly.layer(1, 0)).size, 201)
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
load("test_epilogue.rb")
|
||||
|
||||
Reference in New Issue
Block a user