Skip to content

Commit e921e5d

Browse files
committed
tst: split fixture into odb-only DbFixture and STA Fixture
The tst Fixture unconditionally created a dbSta instance, so every test that used it linked OpenSTA + dbSta even when it only manipulated an odb database (e.g. the odb helper-based tests). OpenSTA/dbSta debug symbols dominate those binaries (~160 MB each). Split Fixture into a base tst::DbFixture (tst/db_fixture.h, odb-only: db manipulation, LEF tech loading, file lookup) and a derived tst::Fixture (tst/fixture.h) that adds the dbSta/OpenSTA instance, readLiberty, and the LEF library loaders that notify STA. The base lives in a new tst_base library (//src/tst:db_fixture in Bazel) that does not link STA. odb DB-only tests and SimpleDbFixture now derive from DbFixture and link tst_base; STA consumers (PDK fixtures, IntegratedFixture, rsz/dbSta/est tests) are unchanged. Mirrored in Bazel. Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
1 parent 203332d commit e921e5d

17 files changed

Lines changed: 348 additions & 247 deletions

src/odb/test/cpp/BUILD

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ cc_test(
4747
deps = [
4848
"//src/odb/src/db",
4949
"//src/odb/test/cpp/helper",
50-
"//src/tst",
50+
"//src/tst:db_fixture",
5151
"@googletest//:gtest",
5252
"@googletest//:gtest_main",
5353
"@spdlog",
@@ -102,7 +102,7 @@ cc_test(
102102
"//src/odb/src/db",
103103
"//src/odb/src/gdsin",
104104
"//src/odb/src/gdsout",
105-
"//src/tst",
105+
"//src/tst:db_fixture",
106106
"//src/utl",
107107
"@googletest//:gtest",
108108
"@googletest//:gtest_main",
@@ -235,7 +235,7 @@ cc_test(
235235
srcs = ["TestObjectType.cpp"],
236236
deps = [
237237
"//src/odb/src/db",
238-
"//src/tst",
238+
"//src/tst:db_fixture",
239239
"@googletest//:gtest",
240240
"@googletest//:gtest_main",
241241
],
@@ -271,7 +271,7 @@ cc_test(
271271
"//src/odb/src/3dblox",
272272
"//src/odb/src/db",
273273
"//src/odb/test/cpp/helper",
274-
"//src/tst",
274+
"//src/tst:db_fixture",
275275
"@googletest//:gtest",
276276
"@googletest//:gtest_main",
277277
],
@@ -292,7 +292,7 @@ cc_test(
292292
deps = [
293293
"//src/odb/src/3dblox",
294294
"//src/odb/src/db",
295-
"//src/tst",
295+
"//src/tst:db_fixture",
296296
"@googletest//:gtest",
297297
"@googletest//:gtest_main",
298298
],
@@ -309,7 +309,7 @@ cc_test(
309309
deps = [
310310
"//src/odb/src/3dblox",
311311
"//src/odb/src/db",
312-
"//src/tst",
312+
"//src/tst:db_fixture",
313313
"@googletest//:gtest",
314314
"@googletest//:gtest_main",
315315
],

src/odb/test/cpp/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ target_link_libraries(OdbGTests
4444
target_link_libraries(TestCallBacks
4545
db
4646
odb_test_helper
47-
tst
47+
tst_base
4848
spdlog::spdlog
4949
${GTEST_LIBS}
5050
)
@@ -105,7 +105,7 @@ target_link_libraries(TestGDSIn
105105
db
106106
gdsin
107107
gdsout
108-
tst
108+
tst_base
109109
utl_lib
110110
${GTEST_LIBS}
111111
)
@@ -118,19 +118,19 @@ target_link_libraries(Test3DBloxParser
118118
3dblox
119119
db
120120
odb_test_helper
121-
tst
121+
tst_base
122122
${GTEST_LIBS}
123123
)
124124
target_link_libraries(Test3DBloxChecker
125125
3dblox
126126
db
127-
tst
127+
tst_base
128128
${GTEST_LIBS}
129129
)
130130
target_link_libraries(Test3DBloxVerilogWriter
131131
3dblox
132132
db
133-
tst
133+
tst_base
134134
${GTEST_LIBS}
135135
)
136136
target_link_libraries(TestSwapMaster
@@ -153,7 +153,7 @@ target_link_libraries(TestWriteReadDbHier
153153
)
154154
target_link_libraries(TestObjectType
155155
db
156-
tst
156+
tst_base
157157
${GTEST_LIBS}
158158
)
159159

src/odb/test/cpp/Test3DBloxCheckerFixture.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
#include "odb/db.h"
1010
#include "odb/dbWireCodec.h"
1111
#include "odb/geom.h"
12-
#include "tst/fixture.h"
12+
#include "tst/db_fixture.h"
1313

1414
namespace odb {
15-
class CheckerFixture : public tst::Fixture
15+
class CheckerFixture : public tst::DbFixture
1616
{
1717
protected:
1818
CheckerFixture()

src/odb/test/cpp/Test3DBloxParser.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
#include "odb/3dblox.h"
99
#include "odb/db.h"
1010
#include "odb/geom.h"
11-
#include "tst/fixture.h"
11+
#include "tst/db_fixture.h"
1212

1313
namespace odb {
1414
namespace {
1515

1616
static const std::string prefix("_main/src/odb/test/");
1717

18-
class DbvFixture : public tst::Fixture
18+
class DbvFixture : public tst::DbFixture
1919
{
2020
protected:
2121
DbvFixture()
@@ -441,7 +441,7 @@ TEST_F(SimpleDbFixture, test_bterm_get_chip_bump)
441441
// Path Assertion Parser Tests
442442
// ---------------------------------------------------------------------------
443443

444-
class PathAssertionFixture : public tst::Fixture
444+
class PathAssertionFixture : public tst::DbFixture
445445
{
446446
protected:
447447
ThreeDBlox parser_{&logger_, db_.get()};

src/odb/test/cpp/Test3DBloxVerilogWriter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include "odb/3dblox.h"
1414
#include "odb/db.h"
1515
#include "odb/geom.h"
16-
#include "tst/fixture.h"
16+
#include "tst/db_fixture.h"
1717

1818
namespace odb {
1919
namespace {
@@ -26,7 +26,7 @@ static std::string readFileContent(const std::string& path)
2626
std::istreambuf_iterator<char>());
2727
}
2828

29-
class VerilogWriterFixture : public tst::Fixture
29+
class VerilogWriterFixture : public tst::DbFixture
3030
{
3131
protected:
3232
VerilogWriterFixture()

src/odb/test/cpp/TestCallBacks.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include "helper.h"
44
#include "odb/db.h"
55
#include "odb/dbTypes.h"
6-
#include "tst/fixture.h"
6+
#include "tst/db_fixture.h"
77

88
namespace odb {
99
namespace {

src/odb/test/cpp/TestGDSIn.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@
1212
#include "odb/gdsin.h"
1313
#include "odb/gdsout.h"
1414
#include "odb/geom.h"
15-
#include "tst/fixture.h"
15+
#include "tst/db_fixture.h"
1616
#include "utl/Logger.h"
1717

1818
namespace odb::gds {
1919
namespace {
2020

2121
static const std::string prefix("_main/src/odb/test/");
2222

23-
using tst::Fixture;
23+
using tst::DbFixture;
2424

25-
TEST_F(Fixture, reader)
25+
TEST_F(DbFixture, reader)
2626
{
2727
GDSReader reader(&logger_);
2828
std::string path = getFilePath(prefix + "data/sky130_fd_sc_hd__inv_1.gds");
@@ -80,7 +80,7 @@ TEST_F(Fixture, reader)
8080
EXPECT_EQ(text0->getTransform().angle_, 0);
8181
}
8282

83-
TEST_F(Fixture, writer)
83+
TEST_F(DbFixture, writer)
8484
{
8585
GDSReader reader(&logger_);
8686
std::string path = getFilePath(prefix + "data/sky130_fd_sc_hd__inv_1.gds");
@@ -146,7 +146,7 @@ TEST_F(Fixture, writer)
146146
EXPECT_EQ(text0->getTransform().angle_, 0);
147147
}
148148

149-
TEST_F(Fixture, edit)
149+
TEST_F(DbFixture, edit)
150150
{
151151
std::string libname = "test_lib";
152152
dbGDSLib* lib = createEmptyGDSLib(db_.get(), libname);

src/odb/test/cpp/TestObjectType.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
#include "gtest/gtest.h"
55
#include "odb/dbObject.h"
66
#include "odb/dbStream.h"
7-
#include "tst/fixture.h"
7+
#include "tst/db_fixture.h"
88

99
namespace odb {
1010
namespace {
1111

12-
class ObjectTypeFixture : public tst::Fixture
12+
class ObjectTypeFixture : public tst::DbFixture
1313
{
1414
};
1515

src/odb/test/cpp/helper/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ cc_library(
2020
visibility = ["//visibility:public"],
2121
deps = [
2222
"//src/odb/src/db",
23-
"//src/tst",
23+
"//src/tst:db_fixture",
2424
],
2525
)

src/odb/test/cpp/helper/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ add_library(odb_test_helper helper.cpp)
77
target_link_libraries(odb_test_helper
88
PUBLIC
99
db
10-
tst
10+
tst_base
1111
)
1212

1313

0 commit comments

Comments
 (0)