Commit Graph

20 Commits

Author SHA1 Message Date
Jaehyun Kim 434246a8b4 Fix test suite for upstream API changes after merge
Adapt all C++ and Tcl tests for upstream API refactoring:
- Header rename: DelayFloat.hh -> Delay.hh
- PocvMode enum replacing boolean pocv (setPocvEnabled -> setPocvMode)
- setReportPathFields gains 8th parameter (report_src_attr)
- GateTableModel/CheckTableModel constructor wraps in TableModels
- gateDelay/checkDelay signature changes (bool -> MinMax/PocvMode)
- Unit::asString returns std::string instead of const char*
- ExceptionThru/To::asString removed, use to_string
- GroupPath/FilterPath/LoopPath::asString removed
- PathEnd::source_clk_delay -> source_clk_latency
- report_net -connections flag removed
- set_report_path_field_width removed
- MaxSkewCheck::skew() now requires sta parameter
- Remove tests that pass nullptr to PinIdHash-based maps (segfault)
- Remove tests for removed APIs (sigmaFactor, reportSigmas)
- Regolden .ok files for numerical precision and format changes

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
2026-03-21 19:23:36 +09:00
Jaehyun Kim 9547beead3 Merge remote-tracking branch 'origin/secure-bump-opensta-0321' into secure-sta-test-by-opus
Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
2026-03-21 18:54:41 +09:00
Jaehyun Kim aac881a974 update test files for upstream API refactoring
Adapt all cpp/tcl test files to match upstream OpenSTA API changes:
- string* output params changed to string return values (Verilog, Network)
- Report methods renamed (reportLineString->reportLine, printf->std::format)
- Delay type refactored from float typedef to class (Graph)
- Liberty model APIs updated (value semantics, shared_ptr, PocvMode)
- EXPECT_STREQ -> EXPECT_EQ for std::string returns (Sdc, Search)
- streamPrint -> sta::print with std::format specifiers (Spice)
- Avoid unset_clock_groups -all path (upstream iterator invalidation bug)

Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
2026-03-21 18:46:31 +09:00
Jaehyun Kim 9b7c99de85 test: fix StaTclInterpAccess failure in Release builds
Sta::tcl_interp_ is not initialized in the constructor, so
tclInterp() returns garbage before setTclInterp() is called.
The assertion `before == nullptr` fails in Release builds where
memory is not zero-initialized.

Remove the read of uninitialized tcl_interp_ and the assertion.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
2026-03-20 23:37:35 +09:00
Jaehyun Kim 57e264f252 test: remove tests that pass nullptr Pin to PinIdHash-based maps
PinIdHash::operator()(nullptr) calls network_->id(nullptr) which
dereferences null, causing segfault in CI environments.

Removed 3 tests:
- SdcInitTest.SdcIsLeafPinNonGeneratedClockNull
- StaInitTest.IsClockSrcNoDesign
- StaInitTest.StaIsClockSrcNoDesign2

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
2026-03-20 23:11:25 +09:00
Jaehyun Kim a54a3a4b17 Enable search report field order tests
Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
2026-03-11 18:25:17 +09:00
Jaehyun Kim e7b861051d test: Fix post-merge build errors and regolden .ok files
After merging upstream changes, fix all build errors in C++ test files
and regolden Tcl test golden files to match updated code output.

Build fixes:
- dcalc/test/cpp/TestDcalc.cc: Fix const char* loop iterations, use
  EXPECT_NEAR for uninitialized subnormal float comparison
- liberty/test/cpp/TestLibertyStaBasicsB.cc: Wrap tests using removed
  LibertyBuilder() default constructor in #if 0
- liberty/test/cpp/TestLibertyStaCallbacks.cc: Fix LibertyBuilder()
  call to use sta_->debug()/report(); wrap old visitor tests in #if 0
- search/test/cpp/TestSearchStaDesignB.cc: Fix pg->name() nullptr
  comparison (now returns std::string&)
- search/test/cpp/TestSearchStaInit.cc: Fix 5 clkPinsInvalid/isIdealClock
  tests to expect throw (API now requires linked network)

Tcl test fixes:
- Remove calls to removed APIs: report_path_end_header/footer, report_path_end2
  from 6 search test scripts; regolden their .ok files
- Regolden .ok files for liberty (15), graph (1), network (8),
  parasitics (3), sdc (3), util (2), verilog (8) modules to reflect
  upstream format changes (timing arcs output, pin ordering, spacing)

All 6103 tests now pass.

Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
2026-03-11 17:11:08 +09:00
Jaehyun Kim 92bb9b8ec9 test: Add comprehensive test infrastructure and test cases across all OpenSTA modules
Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
2026-02-27 12:59:25 +09:00
Jaehyun Kim 9bbac53157 test: Make ctest run C++ unit tests
Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
2026-02-27 09:51:10 +09:00
Jaehyun Kim 8adbcc0d6d Merge upstream STA update and adapt all tests to new API
Major upstream refactoring: Corner→Scene, Mode architecture, warning
format change (Warning ID:), command renames, and many API signature
changes. Adapted all C++ test files and TCL test scripts/expected
output files to pass with the new API. 6159/6159 tests pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
2026-02-23 23:05:29 +09:00
Jaehyun Kim 7173c10cc1 test: strengthen assertions, add sorted SDC diff, and clean up tests
- Split oversized test files to stay under 5,000 lines per file:
  TestSdc.cc → TestSdcClasses.cc, TestSdcStaInit.cc, TestSdcStaDesign.cc
  TestSearchStaDesign.cc → TestSearchStaDesign.cc, TestSearchStaDesignB.cc
  TestLibertyStaBasics.cc → TestLibertyStaBasics.cc, TestLibertyStaBasicsB.cc
  TestNetwork.cc → TestNetwork.cc, TestNetworkB.cc
- Replace ~200+ (void) casts with proper EXPECT_* assertions across all
  C++ test files (dcalc, liberty, network, sdc, search, power, spice, util)
- Remove ~55 SUCCEED() and EXPECT_TRUE(true) no-op assertions
- Fix 6 load-only Tcl tests by adding diff_files verification with
  22 new .sdcok golden reference files
- Delete 7 orphan .ok files with no matching .tcl tests
- Add how_to_write_good_tests.md and TODO6.md documenting test quality rules

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
2026-02-23 17:36:45 +09:00
Jaehyun Kim a242c3f2f2 Refactor test suites and strengthen cpp test assertions 2026-02-23 14:13:29 +09:00
Jaehyun Kim a58d7e4cc6 test: add explicit assertions to all cpp test cases
Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
2026-02-22 21:14:35 +09:00
Jaehyun Kim b55fcabee4 test: improve test stability and assertions
Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
2026-02-22 20:34:07 +09:00
Jaehyun Kim 76b12eb2d2 test: Improve test assertions and stabilize multimodule write test
Strengthen C++ test assertions in TestSdc and TestSearch with actual
value checks. Stabilize verilog_multimodule_write by using clear_sta
for isolated roundtrips. Add report_checks to wireload model tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
2026-02-22 19:25:58 +09:00
Jaehyun Kim 0693e7d479 test: Strengthen C++ test assertions with meaningful checks
Replace empty-body checks and trivial file-existence assertions with
actual content verification and state validation in C++ unit tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
2026-02-22 18:52:36 +09:00
Jaehyun Kim e57c8043cd test: Apply review feedback - part3
Remove unnecessary catch blocks from Tcl test files across all modules,
add report_checks after each set_wire_load_model in liberty_wireload,
rewrite liberty_sky130_corners for actual multi-corner timing analysis
with define_corners, and expand C++ tests (TestSearchIncremental 8→36,
TestPower 71→96, TestSpice 98→126 tests).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 13:05:07 +09:00
Jaehyun Kim 6799b1909a test: Apply review feedback - part1
Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
2026-02-19 23:30:23 +09:00
Jaehyun Kim b77779f7a6 test: Refactoring. Standardize Google Test naming conventions by removing `R#_` prefixes, improve temporary file creation with `mkstemp`, etc
Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
2026-02-13 20:36:42 +09:00
Jaehyun Kim d6c09372ba test: Initial upload
Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
2026-02-13 19:19:09 +09:00