Clean up test suite: remove dead code, fix race conditions, centralize helpers#332
Conversation
- Remove temp files: network_gcd_traversal.log, util_report_redirect.log - Delete 19 comment-only C++ test stubs (dead code for removed APIs) - Remove redundant graph_make_verify test (covered by graph_advanced) - Centralize assert_file_nonempty/assert_file_contains into test/helpers.tcl and remove inline copies from 17 verilog test files - Fix Build.sh stray quotes in heredoc output - Fix regression.sh unquoted variable expansions - Update .gitignore: add */test/*.log and Testing/ All 6087 tests pass. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
…-cleanup Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
…ate/OpenSTA into secure-test-suite-cleanup Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
The merge-base changed after approval.
Could you please approve again? |
The merge-base changed after approval.
dsengupta0628
left a comment
There was a problem hiding this comment.
Hi Jaehyun-before I add review for this issue, can you please make sure OpenROAD compilation goes through with the new STA changes? I was trying to update OpenROAD's src/sta to latest OpenSTA head with a PR, when I saw that OpenROAD fails.
I can reproduce the compilation errors locally by setting the flags to treat Warnings as errors (as done in Jenkins). Example below (use this command to compile from OpenROAD ./etc/Build.sh -clean -no-warnings -no-gui )
/workspace/localrepos/orfs_merge_lvf_sta/tools/OpenROAD/src/sta/liberty/test/cpp/TestLibertyStaCallbacks.cc: In function ‘void sta::expectStaLibertyCoreState(Sta*, LibertyLibrary*)’:
/workspace/localrepos/orfs_merge_lvf_sta/tools/OpenROAD/src/sta/liberty/test/cpp/TestLibertyStaCallbacks.cc:45:6: error: suggest explicit braces to avoid ambiguous ‘else’ [-Werror=dangling-else]
45 | if (!sta->scenes().empty())
| ^
/workspace/localrepos/orfs_merge_lvf_sta/tools/OpenROAD/src/sta/liberty/test/cpp/TestLibertyStaBasicsB.cc: In function ‘void sta::expectStaLibertyCoreState(Sta*, LibertyLibrary*)’:
/workspace/localrepos/orfs_merge_lvf_sta/tools/OpenROAD/src/sta/liberty/test/cpp/TestLibertyStaBasicsB.cc:43:6: error: suggest explicit braces to avoid ambiguous ‘else’ [-Werror=dangling-else]
43 | if (!sta->scenes().empty())
| ^
/workspace/localrepos/orfs_merge_lvf_sta/tools/OpenROAD/src/sta/network/test/cpp/TestNetworkB.cc: In member function ‘virtual void sta::ConcreteNetworkLinkedTest_MakeTermAndTermName_Test::TestBody()’:
/workspace/localrepos/orfs_merge_lvf_sta/tools/OpenROAD/src/sta/network/test/cpp/TestNetworkB.cc:1538:10: error: unused variable ‘tnet_check’ [-Werror=unused-variable]
1538 | Net *tnet_check = network_.net(term);
dsengupta0628
left a comment
There was a problem hiding this comment.
This is a well-structured cleanup PR that reduces test suite maintenance burden without losing coverage.
- Eliminates real parallel test hazards: the read_sdc roundtrip blocks shared temp files, which is a legitimate race condition under ctest -j
- Consolidates before removing: dedicated roundtrip tests (sdc_write_roundtrip.tcl, sdc_write_roundtrip_full.tcl) already exist, so the scattered copies were truly redundant
- Helper centralization is clean: 17 duplicate proc definitions collapsed into test/helpers.tcl which was already being sourced
- Dead C++ stubs (19 empty test bodies) were pure noise inflating test counts
- Shell script fixes are genuine bug fixes (heredoc stray quotes, unquoted variables)
- Committed log artifacts removed and properly gitignored
|
@dsengupta0628 Thank you for the guide. I will check and clean it up. |
…leanup Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
|
@dsengupta0628 By the way, if OpenROAD CI uses
|
…ate/OpenSTA into secure-test-suite-cleanup Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
The remove_constraints API was permanently removed from Sta. Delete the commented-out calls, TODO comments, and "skipped" print statements instead of keeping placeholder blocks. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
Previously these functions returned 1 on mismatch but no caller checked the return value, allowing roundtrip failures to go undetected. Now they call error() so the sta process exits non-zero and the regression runner catches the failure. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
The valid field name is "net" (singular) per search/Search.tcl. Using "nets" triggered Warning 168 (unknown field) silently in 29 test scripts. Fix the field name and regolden .ok files. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
dsengupta0628
left a comment
There was a problem hiding this comment.
I would leave CMakeLists.txt out from this set of change at least- if at all we want to take it, it should be in a separate PR.
| option(USE_TCL_READLINE "Use TCL readline package" ON) | ||
| option(ENABLE_TSAN "Compile with thread santizer enabled" OFF) | ||
| option(ENABLE_ASAN "Compile with address santizer enabled" OFF) | ||
| option(ALLOW_WARNINGS "Allow compiler warnings without failing the build" OFF) |
There was a problem hiding this comment.
In OR we make the default ON so that users compiling with various compilers won't get stuck. In the CI we set it OFF to catch development issues. Developers can do that same locally.
There was a problem hiding this comment.
OK. I'll revert this CMakeLists.txt change. Let's revist it later with other considerations.
| # sta::remove_constraints | ||
| # report_checks | ||
| puts "remove_constraints: skipped (API removed)" | ||
|
|
||
| # Re-add constraints for write_sdc |
There was a problem hiding this comment.
Just removing the comment doesn't really fix the issue. We are not re-adding anything as the prior constraints are still present. I don't think these tests test what they think they do.
There was a problem hiding this comment.
You're right. I'll clean them up tomorrow.
Summary
TestSearchStaInit.cc,TestSearchStaDesign.cc,TestSearchStaDesignB.ccassert_file_nonempty/assert_file_containstotest/helpers.tcl, remove 17 inline definitions in verilog testsread_sdcroundtrip sections from 20 SDC tests to fixctest -j30file-level race condition (two tests sharingsdc_exc_override1.sdc)graph_make_verifytest (covered bygraph_advanced)network_gcd_traversal.log,util_report_redirect.log)*/test/*.logandTesting/to.gitignoretest/regression.sh"inetc/Build.shRegression
6087/6087 tests pass (
ctest -j$(nproc))Related