mirror of https://github.com/KLayout/klayout.git
WIP: bug fixes and more tests
This commit is contained in:
parent
b133bde1c7
commit
e396b6ec29
|
|
@ -698,7 +698,9 @@ public:
|
||||||
} else {
|
} else {
|
||||||
std::vector<QWidget *> pages;
|
std::vector<QWidget *> pages;
|
||||||
for (auto p = eo_pages->pages ().begin (); p != eo_pages->pages ().end (); ++p) {
|
for (auto p = eo_pages->pages ().begin (); p != eo_pages->pages ().end (); ++p) {
|
||||||
pages.push_back (*p);
|
if ((*p)->plugin_declaration () == plugin_declaration ()) {
|
||||||
|
pages.push_back (*p);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return pages;
|
return pages;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,18 @@ class PluginFactory < RBA::PluginFactory
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
class Plugin2EditorOptionsPage < RBA::EditorOptionsPage
|
||||||
|
def initialize
|
||||||
|
super("title", 1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
class Plugin2ConfigPage < RBA::ConfigPage
|
||||||
|
def initialize
|
||||||
|
super("title")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
class Plugin2 < RBA::Plugin
|
class Plugin2 < RBA::Plugin
|
||||||
def set_tp(tp)
|
def set_tp(tp)
|
||||||
@tp = tp
|
@tp = tp
|
||||||
|
|
@ -51,16 +63,32 @@ end
|
||||||
|
|
||||||
class PluginFactory2 < RBA::PluginFactory
|
class PluginFactory2 < RBA::PluginFactory
|
||||||
def initialize()
|
def initialize()
|
||||||
register(1001, "plugin_for_test2", "Plugin2")
|
@ep = 0
|
||||||
|
@cp = 0
|
||||||
@pi = nil
|
@pi = nil
|
||||||
|
register(1001, "plugin_for_test2", "Plugin2")
|
||||||
end
|
end
|
||||||
def create_plugin(manager, unused, view)
|
def create_plugin(manager, unused, view)
|
||||||
@pi = Plugin2::new
|
@pi = Plugin2::new
|
||||||
@pi
|
@pi
|
||||||
end
|
end
|
||||||
|
def create_editor_options_pages
|
||||||
|
add_editor_options_page(Plugin2EditorOptionsPage::new)
|
||||||
|
@ep += 1
|
||||||
|
end
|
||||||
|
def create_config_pages
|
||||||
|
add_config_page(Plugin2ConfigPage::new)
|
||||||
|
@cp += 1
|
||||||
|
end
|
||||||
def pi
|
def pi
|
||||||
@pi
|
@pi
|
||||||
end
|
end
|
||||||
|
def ep
|
||||||
|
@ep
|
||||||
|
end
|
||||||
|
def cp
|
||||||
|
@cp
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class LayPlugin_TestClass < TestBase
|
class LayPlugin_TestClass < TestBase
|
||||||
|
|
@ -114,6 +142,11 @@ class LayPlugin_TestClass < TestBase
|
||||||
pi2.set_tp(nil)
|
pi2.set_tp(nil)
|
||||||
assert_equal(pi2.has_tracking_position_test, false)
|
assert_equal(pi2.has_tracking_position_test, false)
|
||||||
|
|
||||||
|
assert_equal(dpi2.ep, 1)
|
||||||
|
assert_equal(dpi2.cp, 1)
|
||||||
|
assert_equal(pi2.editor_options_pages.size, 1)
|
||||||
|
assert_equal(pi2.editor_options_pages[0].class.to_s, "Plugin2EditorOptionsPage")
|
||||||
|
|
||||||
pi.configure_test("edit-grid", "0.0")
|
pi.configure_test("edit-grid", "0.0")
|
||||||
assert_equal(pi.snap(RBA::DPoint::new(0.01, 0.02)).to_s, "0.01,0.02")
|
assert_equal(pi.snap(RBA::DPoint::new(0.01, 0.02)).to_s, "0.01,0.02")
|
||||||
assert_equal(pi.snap(RBA::DVector::new(0.01, 0.02)).to_s, "0.01,0.02")
|
assert_equal(pi.snap(RBA::DVector::new(0.01, 0.02)).to_s, "0.01,0.02")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue