test/odb: replace design_is_routed golden tests with C++ unit tests#10733
Conversation
Convert the design_is_routed{1,2,3} and design_is_routed_fail{1,2} golden
Tcl tests into TestDesignIsRouted C++ unit tests that assert the boolean
result and verbose ODB-0232 warning behavior of dbBlock::designIsRouted()
directly, instead of diffing serialized logs.
The C++ tests cover the same behaviors (routed signal nets, ignored special
nets, mixed designs, and unrouted detection with and without verbose) plus
single-pin and empty-design edge cases the golden tests never reached.
design_is_routed1.def is retained (renamed to all_pins_placed2.def) since
all_pins_placed2 still uses it; the glob picks it up so the explicit Bazel
data dep is dropped. Registered in both CMake and Bazel.
Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
There was a problem hiding this comment.
Code Review
This pull request replaces several legacy Tcl/DEF-based integration tests for the design_is_routed functionality with a comprehensive suite of C++ unit tests in src/odb/test/cpp/TestDesignIsRouted.cpp. The new unit tests thoroughly verify the behavior of dbBlock::designIsRouted() under various scenarios, including routed signal nets, ignored special nets, single-pin nets, empty designs, unrouted signal nets, and verbose vs. non-verbose warning counts. Legacy test files and their corresponding build configurations in CMake and Bazel have been removed. There are no review comments on this pull request, and I have no feedback to provide.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2e44977790
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| makeMultiPinNet("n2"); | ||
|
|
||
| const int warnings_before = logger_.getWarningCount(); | ||
| EXPECT_FALSE(block_->designIsRouted(/*verbose=*/true)); |
There was a problem hiding this comment.
This replacement exercises the verbose path only through the C++ API, but the deleted Tcl regressions were the only tests that invoked design_is_routed -verbose; a repo-wide check shows the remaining Tcl callers use non-verbose mode in test/flow.tcl:237 and production src/rsz/src/Resizer.tcl:366, while the flag parsing lives in src/odb/src/swig/tcl/odb.tcl:680-692. If the Tcl flag parsing or SWIG dispatch regresses, this new test still passes, so please keep one Tcl-level verbose regression or add an equivalent wrapper-level test.
Useful? React with 👍 / 👎.
Converts the
design_is_routed{1,2,3}anddesign_is_routed_fail{1,2}golden Tcl tests intoTestDesignIsRoutedC++ unit tests that assert the boolean result and verboseODB-0232warning behavior ofdbBlock::designIsRouted()directly, rather than diffing serialized logs. This follows the C++-first testing strategy (docs/agents/testing-strategy.md): a golden test is retired in the same change that re-expresses its coverage in C++.Coverage mapping
RoutedSignalNetSpecialNetsAreIgnoredMixedSpecialAndRoutedSignalNetsUnroutedSignalNetFailsUnroutedSignalNetWithSpecialNetsFailsVerboseWarnsForEachUnroutedNetNonVerboseEmitsNoWarningSinglePinNetIsRoutedEmptyDesignIsRoutedThe last two assert more than the golden tests reached.
design_is_routedbinding coverage remains viatest/flow.tclandsrc/rsz/src/Resizer.tcl.Notes
design_is_routed1.defis renamed toall_pins_placed2.def(its only remaining user); the Bazelglobpicks it up, so the explicit data dep is dropped.OdbGTests) and Bazel (//src/odb/test/cpp:OdbGTests).