Skip to content

Commit c154aab

Browse files
authored
Merge pull request #8538 from hzeller/feature-20251003-layering-check-tests
Enable layering_check in test BUILD files.
2 parents 636e592 + 59c0167 commit c154aab

File tree

45 files changed

+155
-11
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+155
-11
lines changed

bazel/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
load("@openroad_rules_python//python:pip.bzl", "compile_pip_requirements")
22
load("@rules_cc//cc:cc_library.bzl", "cc_library")
33

4+
package(features = ["layering_check"])
5+
46
compile_pip_requirements(
57
name = "requirements",
68
src = "requirements.in",

bazel/openmp/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
package(
1616
default_visibility = ["//visibility:private"],
17+
features = ["layering_check"],
1718
)
1819

1920
exports_files(

etc/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
load("@openroad_rules_python//python:defs.bzl", "py_binary")
22

3+
package(features = ["layering_check"])
4+
35
py_binary(
46
name = "file_to_string",
57
srcs = [

openroad/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ load("@openroad_rules_python//python:defs.bzl", "py_library")
44
# Copyright (c) 2025-2025, The OpenROAD Authors
55
load("@openroad_rules_python//python:packaging.bzl", "py_package", "py_wheel")
66

7+
package(features = ["layering_check"])
8+
79
py_library(
810
name = "openroadpy",
911
srcs = [

src/ant/test/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
load("//test:regression.bzl", "regression_test")
22

3+
package(features = ["layering_check"])
4+
35
# From CMakeLists.txt or_integration_tests(TESTS
46
COMPULSORY_TESTS = [
57
"ant_check",

src/cgt/test/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# Copyright (c) 2025, The OpenROAD Authors
33
load("//test:regression.bzl", "regression_test")
44

5+
package(features = ["layering_check"])
6+
57
TESTS = [
68
"aes_nangate45",
79
"countdown_asap7",

src/cts/test/BUILD

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ load("@rules_cc//cc:cc_test.bzl", "cc_test")
44
# Copyright (c) 2022-2025, The OpenROAD Authors
55
load("//test:regression.bzl", "regression_test")
66

7+
package(features = ["layering_check"])
8+
79
# From CMakeLists.txt or_integration_tests(TESTS
810
COMPULSORY_TESTS = [
911
"array",
@@ -182,10 +184,10 @@ filegroup(
182184
cc_test(
183185
name = "cts_unittest",
184186
srcs = ["cts_unittest.cc"],
187+
features = ["-layering_check"], # TODO: accesses private headers
185188
linkstatic = True, # TODO: remove once deps define all symbols
186189
deps = [
187190
"//src/cts",
188-
"//src/grt", # work around cyclic dependncy between rsz and grt
189191
"//src/utl",
190192
"@googletest//:gtest",
191193
"@googletest//:gtest_main",

src/cut/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ load("@rules_cc//cc:cc_library.bzl", "cc_library")
55

66
package(
77
default_visibility = ["//:__subpackages__"],
8+
features = ["layering_check"],
89
)
910

1011
cc_library(
@@ -31,6 +32,7 @@ cc_library(
3132
includes = ["include"],
3233
deps = [
3334
"//src/dbSta",
35+
"//src/dbSta:dbNetwork",
3436
"//src/odb",
3537
"//src/rsz",
3638
"//src/sta:opensta_lib",

src/cut/test/BUILD

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
load("@rules_cc//cc:cc_test.bzl", "cc_test")
55

6+
package(features = ["layering_check"])
7+
68
cc_test(
79
name = "cut_abc_test",
810
srcs = ["cpp/TestAbc.cc"],
@@ -11,8 +13,13 @@ cc_test(
1113
"//src/cut",
1214
"//src/dbSta",
1315
"//src/dbSta:dbReadVerilog",
16+
"//src/odb",
17+
"//src/sta:opensta_lib",
1418
"//src/tst",
19+
"//src/utl",
20+
"@edu_berkeley_abc//:abc-lib",
1521
"@googletest//:gtest",
1622
"@googletest//:gtest_main",
23+
"@tk_tcl//:tcl",
1724
],
1825
)

src/cut/test/cpp/TestAbc.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
// license that can be found in the LICENSE file or at
55
// https://developers.google.com/open-source/licenses/bsd
66

7-
#include <tcl.h>
87
#include <unistd.h>
98

109
#include <array>
@@ -42,6 +41,7 @@
4241
#include "sta/Sta.hh"
4342
#include "sta/Units.hh"
4443
#include "sta/VerilogReader.hh"
44+
#include "tcl.h"
4545
#include "tst/fixture.h"
4646
#include "utl/Logger.h"
4747
#include "utl/deleter.h"

0 commit comments

Comments
 (0)