Added tests for last change

This commit is contained in:
Matthias Koefferlein 2023-08-02 23:56:51 +02:00
parent cfc84252ab
commit 2eca865bd8
2 changed files with 98 additions and 0 deletions

View File

@ -800,6 +800,77 @@ TEST(14b_SideTargetsAndReports)
compare_text_files (report2, au_report2);
}
TEST(14c_OnlySpecialInputsAndReports)
{
std::string rs = tl::testdata ();
rs += "/drc/drcSimpleTests_14c.drc";
// apart from that it's a variant of 14b ...
std::string input = tl::testdata ();
input += "/drc/drcSimpleTests_14b.gds";
std::string au = tl::testdata ();
au += "/drc/drcSimpleTests_au14b.gds";
std::string au2 = tl::testdata ();
au2 += "/drc/drcSimpleTests_au14b_2.gds";
std::string au_report = tl::testdata ();
au_report += "/drc/drcSimpleTests_au14b.lyrdb";
std::string au_report2 = tl::testdata ();
au_report2 += "/drc/drcSimpleTests_au14b_2.lyrdb";
std::string output = this->tmp_file ("tmp.gds");
std::string output2 = this->tmp_file ("tmp2.gds");
std::string report = this->tmp_file ("tmp.lydrc");
std::string report2 = this->tmp_file ("tmp2.lydrc");
{
// Set some variables
lym::Macro config;
config.set_text (tl::sprintf (
"$drc_force_gc = true\n"
"$drc_test_source = '%s'\n"
"$drc_test_target = '%s'\n"
"$drc_test_target2 = '%s'\n"
"$drc_test_report = '%s'\n"
"$drc_test_report2 = '%s'\n"
, input, output, output2, report, report2)
);
config.set_interpreter (lym::Macro::Ruby);
EXPECT_EQ (config.run (), 0);
}
lym::Macro drc;
drc.load_from (rs);
EXPECT_EQ (drc.run (), 0);
db::Layout layout;
{
tl::InputStream stream (output);
db::Reader reader (stream);
reader.read (layout);
}
db::compare_layouts (_this, layout, au, db::NoNormalization);
db::Layout layout2;
{
tl::InputStream stream (output2);
db::Reader reader (stream);
reader.read (layout2);
}
db::compare_layouts (_this, layout2, au2, db::NoNormalization);
compare_text_files (report, au_report);
compare_text_files (report2, au_report2);
}
TEST(15_issue548)
{
std::string rs = tl::testdata ();

27
testdata/drc/drcSimpleTests_14c.drc vendored Normal file
View File

@ -0,0 +1,27 @@
lyin = layout($drc_test_source)
cn = lyin.layout.top_cell.name
lyin2 = layout($drc_test_source)
target($drc_test_target, cn)
l1 = lyin.input(1, 0)
l2 = lyin2.input(2, 0)
tcopy = new_target($drc_test_target2, cn)
rcopy = new_report("Report 2", $drc_test_report2, cn)
l1.output(tcopy, 101, 0)
l2.output(tcopy, 102, 0)
l1.output(1, 0)
l1.space(1.0.um).output(100, 0)
report("Report 1", $drc_test_report, cn)
l2.space(1.0.um).output("l2 space < 1µm")
l1.width(1.0.um).output("l1 width < 1µm")
l1.sep(l2, 1.0.um).output(rcopy, "l1 sep l2 < 1µm")