Skip to content

Commit

Permalink
Added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koefferlein committed Apr 28, 2024
1 parent 1c367f3 commit fbc336d
Show file tree
Hide file tree
Showing 7 changed files with 1,068 additions and 0 deletions.
71 changes: 71 additions & 0 deletions src/drc/unit_tests/drcSimpleTests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1702,3 +1702,74 @@ TEST(102d_edge_modes)
{
run_test (_this, "102", true);
}

TEST(110_RDBVariantAssignment)
{
std::string rs = tl::testdata ();
rs += "/drc/drcSimpleTests_110.drc";

// apart from that it's a variant of 14b ...

std::string input = tl::testdata ();
input += "/drc/drcSimpleTests_110.gds";

std::string au_report = tl::testdata ();
au_report += "/drc/drcSimpleTests_au110.lyrdb";

std::string report = this->tmp_file ("tmp.lydrc");

{
// Set some variables
lym::Macro config;
config.set_text (tl::sprintf (
"$drc_force_gc = true\n"
"$drc_test_source = '%s'\n"
"$drc_test_report = '%s'\n"
, input, report)
);
config.set_interpreter (lym::Macro::Ruby);
EXPECT_EQ (config.run (), 0);
}

lym::Macro drc;
drc.load_from (rs);
EXPECT_EQ (drc.run (), 0);

compare_text_files (report, au_report);
}

TEST(111_RDBCategoryHierarchy)
{
std::string rs = tl::testdata ();
rs += "/drc/drcSimpleTests_111.drc";

// apart from that it's a variant of 14b ...

std::string input = tl::testdata ();
input += "/drc/drcSimpleTests_111.gds";

std::string au_report = tl::testdata ();
au_report += "/drc/drcSimpleTests_au111.lyrdb";

std::string report = this->tmp_file ("tmp.lydrc");

{
// Set some variables
lym::Macro config;
config.set_text (tl::sprintf (
"$drc_force_gc = true\n"
"$drc_test_source = '%s'\n"
"$drc_test_report = '%s'\n"
, input, report)
);
config.set_interpreter (lym::Macro::Ruby);
EXPECT_EQ (config.run (), 0);
}

lym::Macro drc;
drc.load_from (rs);
EXPECT_EQ (drc.run (), 0);

compare_text_files (report, au_report);
}

16 changes: 16 additions & 0 deletions testdata/drc/drcSimpleTests_110.drc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

source($drc_test_source)
report("Report comment with\nanother line", $drc_test_report)

deep

l1 = input(1, 0)
l1 = l1.sized(0.1, 0.0)

l1.output("l1", "L1 (1/0 sized by x=100nm,y=0)")
l1.drc(width < 1.0.um).output("w1um", "w < 1µm\nFrom sized input")

l1s = l1.snapped(200.nm)
l1s.output("l1_snapped", "L1 snapped to 200nm")
l1s.drc(width < 1.0.um).output("w1um_snapped", "w < 1µm\nFrom snapped input")

Binary file added testdata/drc/drcSimpleTests_110.gds
Binary file not shown.
14 changes: 14 additions & 0 deletions testdata/drc/drcSimpleTests_111.drc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

source($drc_test_source)
report("Report comment with\nanother line", $drc_test_report)

deep

l1 = input(1, 0)
l1s = l1.sized(0.1, 0.0)

l1.output([ "input", "L1" ], "Original layer")
l1s.output([ "input", "L1S" ], "Sized original layer")

l1s.drc(width < 1.0.um).output("w1um", "w < 1µm\nFrom sized input")

Binary file added testdata/drc/drcSimpleTests_111.gds
Binary file not shown.
Loading

0 comments on commit fbc336d

Please sign in to comment.