From 04ce8d74c6daedba49f65f7b35bbefd7e348821e Mon Sep 17 00:00:00 2001 From: Ethan Mahintorabi Date: Mon, 11 Mar 2024 18:58:25 +0000 Subject: [PATCH 1/9] meta: Moving tool tests to ctest Now we can run all the regression tests in parallel. ``` $ ctest -j 128 ... 721/740 Test #501: grt.congestion5 ............................................... Passed 64.21 sec 722/740 Test #503: grt.congestion7 ............................................... Passed 70.06 sec 723/740 Test #488: cts.array_no_blockages ........................................ Passed 71.07 sec 724/740 Test #342: dpo.aes ....................................................... Passed 61.13 sec 725/740 Test #177: rsz.repair_fanout6 ............................................ Passed 73.91 sec 726/740 Test #240: rsz.repair_design3_verbose .................................... Passed 81.89 sec 100% tests passed Label Time Summary: IntegrationTest = 4664.65 sec*proc (714 tests) Total Test time (real) = 354.23 sec ``` Flow tests haven't been moved, because I'm not sure how they should be handled. I figure someone else can figure that out. Signed-off-by: Ethan Mahintorabi --- CMakeLists.txt | 11 +++ src/ant/CMakeLists.txt | 1 + src/ant/test/CMakeLists.txt | 13 ++++ src/cts/test/CMakeLists.txt | 26 +++++++ src/dbSta/CMakeLists.txt | 1 + src/dbSta/test/CMakeLists.txt | 45 ++++++++++++ src/dft/CMakeLists.txt | 2 +- src/dft/test/CMakeLists.txt | 15 +++- src/dpl/test/CMakeLists.txt | 68 ++++++++++++++++++ src/dpo/CMakeLists.txt | 2 + src/dpo/test/CMakeLists.txt | 15 ++++ src/drt/CMakeLists.txt | 2 + src/drt/test/CMakeLists.txt | 18 +++++ src/dst/test/cpp/CMakeLists.txt | 21 ++++++ src/fin/CMakeLists.txt | 2 + src/fin/test/CMakeLists.txt | 9 +++ src/gpl/test/CMakeLists.txt | 66 ++++++++---------- src/grt/CMakeLists.txt | 2 + src/grt/test/CMakeLists.txt | 71 +++++++++++++++++++ src/gui/CMakeLists.txt | 2 + src/gui/test/CMakeLists.txt | 9 +++ src/ifp/CMakeLists.txt | 1 + src/ifp/test/CMakeLists.txt | 33 +++++++++ src/mpl/CMakeLists.txt | 2 + src/mpl/test/CMakeLists.txt | 13 ++++ src/mpl2/CMakeLists.txt | 2 +- src/mpl2/test/CMakeLists.txt | 11 +++ src/odb/CMakeLists.txt | 2 +- src/odb/test/CMakeLists.txt | 45 ++++++++++++ src/pad/CMakeLists.txt | 2 + src/pad/test/CMakeLists.txt | 32 +++++++++ src/par/CMakeLists.txt | 2 + src/par/test/CMakeLists.txt | 10 +++ src/pdn/CMakeLists.txt | 1 + src/pdn/test/CMakeLists.txt | 99 ++++++++++++++++++++++++++ src/ppl/CMakeLists.txt | 2 + src/ppl/test/CMakeLists.txt | 120 ++++++++++++++++++++++++++++++++ src/psm/CMakeLists.txt | 1 + src/psm/test/CMakeLists.txt | 32 +++++++++ src/rcx/CMakeLists.txt | 2 + src/rcx/test/CMakeLists.txt | 13 ++++ src/rmp/CMakeLists.txt | 1 + src/rmp/test/CMakeLists.txt | 18 +++++ src/rsz/CMakeLists.txt | 1 + src/rsz/test/CMakeLists.txt | 118 +++++++++++++++++++++++++++++++ src/stt/CMakeLists.txt | 2 + src/stt/test/CMakeLists.txt | 15 ++++ src/tap/CMakeLists.txt | 3 +- src/tap/test/CMakeLists.txt | 29 ++++++++ src/upf/CMakeLists.txt | 3 +- src/upf/test/CMakeLists.txt | 10 +++ src/utl/CMakeLists.txt | 2 + src/utl/test/CMakeLists.txt | 12 ++++ test/regression_vars.tcl | 3 + 54 files changed, 999 insertions(+), 44 deletions(-) create mode 100644 src/ant/test/CMakeLists.txt create mode 100644 src/dbSta/test/CMakeLists.txt create mode 100644 src/dpo/test/CMakeLists.txt create mode 100644 src/drt/test/CMakeLists.txt create mode 100644 src/fin/test/CMakeLists.txt create mode 100644 src/grt/test/CMakeLists.txt create mode 100644 src/gui/test/CMakeLists.txt create mode 100644 src/ifp/test/CMakeLists.txt create mode 100644 src/mpl/test/CMakeLists.txt create mode 100644 src/mpl2/test/CMakeLists.txt create mode 100644 src/odb/test/CMakeLists.txt create mode 100644 src/pad/test/CMakeLists.txt create mode 100644 src/par/test/CMakeLists.txt create mode 100644 src/pdn/test/CMakeLists.txt create mode 100644 src/ppl/test/CMakeLists.txt create mode 100644 src/psm/test/CMakeLists.txt create mode 100644 src/rcx/test/CMakeLists.txt create mode 100644 src/rmp/test/CMakeLists.txt create mode 100644 src/rsz/test/CMakeLists.txt create mode 100644 src/stt/test/CMakeLists.txt create mode 100644 src/tap/test/CMakeLists.txt create mode 100644 src/upf/test/CMakeLists.txt create mode 100644 src/utl/test/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 65bf62053cb..0eba46bc15a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -142,7 +142,18 @@ configure_file( # Ask CMake to output a compile_commands.json file for use with things like clang-tidy set(CMAKE_EXPORT_COMPILE_COMMANDS 1) +# Integration Test Macro +find_program (BASH_PROGRAM bash REQUIRED) +function(or_integration_test tool_name test_name regression_binary) + add_test ( + NAME ${tool_name}.${test_name} + COMMAND ${BASH_PROGRAM} ${regression_binary} ${test_name} + ) + set_property(TEST ${tool_name}.${test_name} PROPERTY ENVIRONMENT "DIFF_LOCATION=${CMAKE_CURRENT_LIST_DIR}/results/${test_name}.diff") + set_tests_properties(${tool_name}.${test_name} PROPERTIES LABELS "IntegrationTest") +endfunction() +# End Integration Test Macro add_subdirectory(third-party) diff --git a/src/ant/CMakeLists.txt b/src/ant/CMakeLists.txt index 521a2b66b46..68290ee3033 100644 --- a/src/ant/CMakeLists.txt +++ b/src/ant/CMakeLists.txt @@ -30,3 +30,4 @@ # POSSIBILITY OF SUCH DAMAGE. add_subdirectory(src) +add_subdirectory(test) \ No newline at end of file diff --git a/src/ant/test/CMakeLists.txt b/src/ant/test/CMakeLists.txt new file mode 100644 index 00000000000..e1dfd857255 --- /dev/null +++ b/src/ant/test/CMakeLists.txt @@ -0,0 +1,13 @@ +include("openroad") + +set(TEST_NAMES + check_api1 + check_drt1 + check_grt1 + ant_check + ant_report +) + +foreach(TEST_NAME IN LISTS TEST_NAMES) + or_integration_test("ant" ${TEST_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/regression) +endforeach() \ No newline at end of file diff --git a/src/cts/test/CMakeLists.txt b/src/cts/test/CMakeLists.txt index 86c41f885e5..e3781819ad0 100644 --- a/src/cts/test/CMakeLists.txt +++ b/src/cts/test/CMakeLists.txt @@ -6,6 +6,32 @@ include("openroad") +set(TEST_NAMES + check_buffers + check_buffers_blockages + check_charBuf + find_clock + find_clock_pad + no_clocks + no_sinks + simple_test + simple_test_clustered + simple_test_clustered_max_cap + check_wire_rc_cts + post_cts_opt + balance_levels + max_cap + array + array_no_blockages + array_ins_delay + insertion_delay + dummy_load +) + +foreach(TEST_NAME IN LISTS TEST_NAMES) + or_integration_test("cts" ${TEST_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/regression) +endforeach() + add_executable(cts_unittest cts_unittest.cc) target_include_directories(cts_unittest PUBLIC diff --git a/src/dbSta/CMakeLists.txt b/src/dbSta/CMakeLists.txt index 84335f37c92..a2117215a10 100644 --- a/src/dbSta/CMakeLists.txt +++ b/src/dbSta/CMakeLists.txt @@ -34,3 +34,4 @@ ############################################################################### add_subdirectory(src) +add_subdirectory(test) \ No newline at end of file diff --git a/src/dbSta/test/CMakeLists.txt b/src/dbSta/test/CMakeLists.txt new file mode 100644 index 00000000000..1ecd4952a28 --- /dev/null +++ b/src/dbSta/test/CMakeLists.txt @@ -0,0 +1,45 @@ +include("openroad") + +set(TEST_NAMES + constant1 + make_port + network_edit1 + sdc_names1 + sdc_names2 + sdc_get1 + sta1 + sta2 + sta3 + sta4 + sta5 + block_sta1 + find_clks1 + find_clks2 + report_json1 + power1 + read_liberty1 + read_verilog1 + read_verilog2 + read_verilog3 + read_verilog4 + read_verilog5 + read_verilog6 + read_verilog7 + read_verilog8 + read_verilog9 + read_verilog10 + report_cell_usage + write_verilog1 + write_verilog2 + write_verilog3 + write_verilog4 + write_verilog5 + write_verilog6 + write_verilog7 + write_verilog8 + write_sdc1 +) + +foreach(TEST_NAME IN LISTS TEST_NAMES) + or_integration_test("ant" ${TEST_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/regression) +endforeach() \ No newline at end of file diff --git a/src/dft/CMakeLists.txt b/src/dft/CMakeLists.txt index c1937cc59b9..f2c1b524dfb 100644 --- a/src/dft/CMakeLists.txt +++ b/src/dft/CMakeLists.txt @@ -108,7 +108,7 @@ add_subdirectory(src/replace) add_subdirectory(src/stitch) add_subdirectory(src/utils) if(ENABLE_TESTS) - add_subdirectory(test/cpp) + add_subdirectory(test) endif() messages( diff --git a/src/dft/test/CMakeLists.txt b/src/dft/test/CMakeLists.txt index 0aa1867b3df..bb15f33c7cc 100644 --- a/src/dft/test/CMakeLists.txt +++ b/src/dft/test/CMakeLists.txt @@ -1,4 +1,17 @@ # Tests +include("openroad") -find_package(Boost) +set(TEST_NAMES + one_cell_sky130 + one_cell_nangate45 + sub_modules_sky130 + scan_architect_no_mix_sky130 + scan_architect_clock_mix_sky130 +) + +foreach(TEST_NAME IN LISTS TEST_NAMES) + or_integration_test("dft" ${TEST_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/regression) +endforeach() +find_package(Boost) +add_subdirectory(cpp) diff --git a/src/dpl/test/CMakeLists.txt b/src/dpl/test/CMakeLists.txt index 67a5266511e..8f00f200333 100644 --- a/src/dpl/test/CMakeLists.txt +++ b/src/dpl/test/CMakeLists.txt @@ -6,6 +6,74 @@ include("openroad") +set(TEST_NAMES + aes + cell_on_block1 + cell_on_block2 + check1 + check2 + check3 + check4 + check5 + check6 + check7 + check8 + check9 + fence01 + fence02 + fence03 + fillers1 + fillers2 + fillers3 + fillers4 + fillers5 + fillers6 + fillers7 + fillers8 + fragmented_row01 + fragmented_row02 + fragmented_row03 + fragmented_row04 + gcd + hybrid_cells + hybrid_cells2 + ibex + max_disp1 + mirror1 + mirror2 + mirror3 + multi_height_one_site_gap_disallow + multi_height_rows + obstruction1 + obstruction2 + one_site_gap_disallow + pad01 + pad02 + pad03 + pad04 + pad05 + pad06 + pad07 + pad08 + regions1 + regions2 + regions3 + report_failures + simple01 + simple02 + simple03 + simple04 + simple05 + simple07 + simple08 + simple09 + simple10 +) + +foreach(TEST_NAME IN LISTS TEST_NAMES) + or_integration_test("dpl" ${TEST_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/regression) +endforeach() + add_executable(dpl_test dpl_test.cc) target_link_libraries(dpl_test diff --git a/src/dpo/CMakeLists.txt b/src/dpo/CMakeLists.txt index 9d9e7d8a497..db19fd57c1b 100644 --- a/src/dpo/CMakeLists.txt +++ b/src/dpo/CMakeLists.txt @@ -113,3 +113,5 @@ if (Python3_FOUND AND BUILD_PYTHON) ) endif() + +add_subdirectory(test) \ No newline at end of file diff --git a/src/dpo/test/CMakeLists.txt b/src/dpo/test/CMakeLists.txt new file mode 100644 index 00000000000..39b11608b42 --- /dev/null +++ b/src/dpo/test/CMakeLists.txt @@ -0,0 +1,15 @@ +include("openroad") + +set(TEST_NAMES + aes + gcd + ibex + multi_height1 + gcd_no_one_site_gaps + regions1 + regions2 +) + +foreach(TEST_NAME IN LISTS TEST_NAMES) + or_integration_test("dpo" ${TEST_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/regression) +endforeach() diff --git a/src/drt/CMakeLists.txt b/src/drt/CMakeLists.txt index d6078c44faa..de812063562 100644 --- a/src/drt/CMakeLists.txt +++ b/src/drt/CMakeLists.txt @@ -257,3 +257,5 @@ if (Python3_FOUND AND BUILD_PYTHON) ) endif() + +add_subdirectory(test) \ No newline at end of file diff --git a/src/drt/test/CMakeLists.txt b/src/drt/test/CMakeLists.txt new file mode 100644 index 00000000000..f860df48f31 --- /dev/null +++ b/src/drt/test/CMakeLists.txt @@ -0,0 +1,18 @@ +include("openroad") + +set(TEST_NAMES + ispd18_sample + ndr_vias1 + ndr_vias2 + obstruction + single_step + ta_ap_aligned + ta_pin_aligned + top_level_term + top_level_term2 + drc_test +) + +foreach(TEST_NAME IN LISTS TEST_NAMES) + or_integration_test("drt" ${TEST_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/regression) +endforeach() diff --git a/src/dst/test/cpp/CMakeLists.txt b/src/dst/test/cpp/CMakeLists.txt index 8693fbaab54..c23bb8a8218 100644 --- a/src/dst/test/cpp/CMakeLists.txt +++ b/src/dst/test/cpp/CMakeLists.txt @@ -28,3 +28,24 @@ target_include_directories(TestDistributed ${DST_HOME}/src ${OPENROAD_HOME}/include ) + +add_test( + NAME "dst.TestWorker" + COMMAND TestWorker +) + +add_test( + NAME "dst.TestBalancer" + COMMAND TestBalancer +) + +add_test( + NAME "dst.TestDistributed" + COMMAND TestDistributed +) + +add_dependencies(build_and_test + TestWorker + TestBalancer + TestDistributed +) \ No newline at end of file diff --git a/src/fin/CMakeLists.txt b/src/fin/CMakeLists.txt index 274737c5185..0b1127a811e 100644 --- a/src/fin/CMakeLists.txt +++ b/src/fin/CMakeLists.txt @@ -80,3 +80,5 @@ if (Python3_FOUND AND BUILD_PYTHON) ) endif() + +add_subdirectory(test) \ No newline at end of file diff --git a/src/fin/test/CMakeLists.txt b/src/fin/test/CMakeLists.txt new file mode 100644 index 00000000000..ee1ecde82b7 --- /dev/null +++ b/src/fin/test/CMakeLists.txt @@ -0,0 +1,9 @@ +include("openroad") + +set(TEST_NAMES + gcd_fill +) + +foreach(TEST_NAME IN LISTS TEST_NAMES) + or_integration_test("fin" ${TEST_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/regression) +endforeach() diff --git a/src/gpl/test/CMakeLists.txt b/src/gpl/test/CMakeLists.txt index 4c2c908ab6d..ac2b0697818 100644 --- a/src/gpl/test/CMakeLists.txt +++ b/src/gpl/test/CMakeLists.txt @@ -1,47 +1,37 @@ include("openroad") -find_program (BASH_PROGRAM bash REQUIRED) - -function(gpl_test test_name) - add_test ( - NAME gpl.${test_name} - COMMAND ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/regression ${test_name} - ) - set_tests_properties(gpl.${test_name} PROPERTIES LABELS "IntegrationTest") -endfunction() - set(TEST_NAMES -simple01 -simple01-obs -simple01-td -simple01-td-tune -simple01-uniform -simple01-ref -simple01-skip-io -simple02 -simple03 -simple04 -simple05 -simple06 -simple07 -simple08 -simple09 -core01 -ar01 -ar02 -incremental01 -incremental02 -error01 -diverge01 -density01 -convergence01 -nograd01 -clust01 -clust02 + simple01 + simple01-obs + simple01-td + simple01-td-tune + simple01-uniform + simple01-ref + simple01-skip-io + simple02 + simple03 + simple04 + simple05 + simple06 + simple07 + simple08 + simple09 + core01 + ar01 + ar02 + incremental01 + incremental02 + error01 + diverge01 + density01 + convergence01 + nograd01 + clust01 + clust02 ) foreach(TEST_NAME IN LISTS TEST_NAMES) - gpl_test(${TEST_NAME}) + or_integration_test("gpl" ${TEST_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/regression) endforeach() add_executable(fft_test fft_test.cc) diff --git a/src/grt/CMakeLists.txt b/src/grt/CMakeLists.txt index 70f9c4ace8f..c02e9d4a032 100644 --- a/src/grt/CMakeLists.txt +++ b/src/grt/CMakeLists.txt @@ -134,3 +134,5 @@ endif() messages( TARGET grt ) + +add_subdirectory(test) \ No newline at end of file diff --git a/src/grt/test/CMakeLists.txt b/src/grt/test/CMakeLists.txt new file mode 100644 index 00000000000..0be4e9deed6 --- /dev/null +++ b/src/grt/test/CMakeLists.txt @@ -0,0 +1,71 @@ +include("openroad") + +set(TEST_NAMES + bus_route + clock_route + clock_route_alpha + clock_route_error1 + clock_route_error2 + congestion1 + congestion2 + congestion3 + congestion4 + congestion5 + congestion6 + congestion7 + critical_nets_percentage + est_rc1 + est_rc2 + est_rc3 + est_rc4 + gcd + gcd_flute + inst_pin_out_of_die + invalid_routing_layer + invalid_pin_placement + macro_obs_not_aligned + multiple_calls + ndr_1w_3s + ndr_2w_3s + no_tracks + obstruction + obs_out_of_die + overlapping_edges + pd1 + pd2 + pd3 + pd4 + pin_access1 + pin_access2 + pin_edge + pin_track_not_aligned + pre_routed1 + region_adjustment + repair_antennas1 + repair_antennas2 + repair_antennas3 + repair_antennas4 + repair_antennas_error1 + repair_antennas_error2 + report_wire_length1 + report_wire_length2 + report_wire_length3 + report_wire_length4 + report_wire_length5 + report_wire_length6 + set_nets_to_route1 + silence + single_row + top_level_term1 + top_level_term2 + top_level_term3 + tracks1 + tracks2 + tracks3 + upper_layer_net + modeling_instance_obs +) + +foreach(TEST_NAME IN LISTS TEST_NAMES) + or_integration_test("grt" ${TEST_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/regression) +endforeach() diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 77cf1b19b55..1707876c36f 100755 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -115,3 +115,5 @@ target_include_directories(gui ${OPENSTA_HOME}/include ${DBSTA_HOME}/include ) + +add_subdirectory(test) \ No newline at end of file diff --git a/src/gui/test/CMakeLists.txt b/src/gui/test/CMakeLists.txt new file mode 100644 index 00000000000..3fad41973ec --- /dev/null +++ b/src/gui/test/CMakeLists.txt @@ -0,0 +1,9 @@ +include("openroad") + +set(TEST_NAMES + supported +) + +foreach(TEST_NAME IN LISTS TEST_NAMES) + or_integration_test("gui" ${TEST_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/regression) +endforeach() diff --git a/src/ifp/CMakeLists.txt b/src/ifp/CMakeLists.txt index 84335f37c92..a2117215a10 100644 --- a/src/ifp/CMakeLists.txt +++ b/src/ifp/CMakeLists.txt @@ -34,3 +34,4 @@ ############################################################################### add_subdirectory(src) +add_subdirectory(test) \ No newline at end of file diff --git a/src/ifp/test/CMakeLists.txt b/src/ifp/test/CMakeLists.txt new file mode 100644 index 00000000000..4faeb54197c --- /dev/null +++ b/src/ifp/test/CMakeLists.txt @@ -0,0 +1,33 @@ +include("openroad") + +set(TEST_NAMES + hybrid_rows + hybrid_rows2 + init_floorplan1 + init_floorplan2 + init_floorplan3 + init_floorplan4 + init_floorplan5 + init_floorplan6 + init_floorplan7 + init_floorplan8 + init_floorplan9 + make_tracks1 + make_tracks2 + make_tracks3 + make_tracks4 + make_tracks5 + make_tracks6 + make_tracks7 + multi_height1 + multi_height2 + placement_blockage1 + placement_blockage2 + tiecells + upf_test + upf_shifter_test +) + +foreach(TEST_NAME IN LISTS TEST_NAMES) + or_integration_test("ifp" ${TEST_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/regression) +endforeach() diff --git a/src/mpl/CMakeLists.txt b/src/mpl/CMakeLists.txt index a65d8930e17..8f042744ebc 100644 --- a/src/mpl/CMakeLists.txt +++ b/src/mpl/CMakeLists.txt @@ -87,3 +87,5 @@ if (Python3_FOUND AND BUILD_PYTHON) ) endif() + +add_subdirectory(test) diff --git a/src/mpl/test/CMakeLists.txt b/src/mpl/test/CMakeLists.txt new file mode 100644 index 00000000000..0b52c691446 --- /dev/null +++ b/src/mpl/test/CMakeLists.txt @@ -0,0 +1,13 @@ +include("openroad") + +set(TEST_NAMES + level3_01 + level3_02 + east_west1 + east_west2 + snap_layer1 +) + +foreach(TEST_NAME IN LISTS TEST_NAMES) + or_integration_test("mpl" ${TEST_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/regression) +endforeach() diff --git a/src/mpl2/CMakeLists.txt b/src/mpl2/CMakeLists.txt index a677113bde6..9406a52806a 100644 --- a/src/mpl2/CMakeLists.txt +++ b/src/mpl2/CMakeLists.txt @@ -91,5 +91,5 @@ target_link_libraries(mpl2 ) if(ENABLE_TESTS) - add_subdirectory(test/cpp) + add_subdirectory(test) endif() diff --git a/src/mpl2/test/CMakeLists.txt b/src/mpl2/test/CMakeLists.txt new file mode 100644 index 00000000000..cb04709bab0 --- /dev/null +++ b/src/mpl2/test/CMakeLists.txt @@ -0,0 +1,11 @@ +include("openroad") + +set(TEST_NAMES + macro_only +) + +foreach(TEST_NAME IN LISTS TEST_NAMES) + or_integration_test("mpl2" ${TEST_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/regression) +endforeach() + +add_subdirectory(cpp) diff --git a/src/odb/CMakeLists.txt b/src/odb/CMakeLists.txt index 9bd1a419e48..a8085374442 100644 --- a/src/odb/CMakeLists.txt +++ b/src/odb/CMakeLists.txt @@ -29,7 +29,7 @@ add_subdirectory(src/zutil) add_subdirectory(src/cdl) if(ENABLE_TESTS) - add_subdirectory(test/cpp) + add_subdirectory(test) endif() add_library(odb INTERFACE) diff --git a/src/odb/test/CMakeLists.txt b/src/odb/test/CMakeLists.txt new file mode 100644 index 00000000000..8ff7fd04b2b --- /dev/null +++ b/src/odb/test/CMakeLists.txt @@ -0,0 +1,45 @@ +include("openroad") + +set(TEST_NAMES + bterm_hier_create + multi_tech + transform + rounding + sky130hd_multi_patterned + dont_touch + import_package + read_lef + read_db + read_zipped + create_sboxes + dump_via_rules + dump_vias + read_def + read_def58 + write_def58 + dump_nets + lef_mask + write_lef_and_def + lef_data_access + gcd_def_access + gcd_pdn_def_access + edit_def + wire_encoder + edit_via_params + row_settings + db_read_write + check_routing_tracks + polygon + def_parser + ndr + gcd_abstract_lef + gcd_abstract_lef_with_power + abstract_origin + write_macro_placement +) + +foreach(TEST_NAME IN LISTS TEST_NAMES) + or_integration_test("odb" ${TEST_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/regression) +endforeach() + +add_subdirectory(cpp) \ No newline at end of file diff --git a/src/pad/CMakeLists.txt b/src/pad/CMakeLists.txt index dfa6a32f360..d3d3960fd6d 100644 --- a/src/pad/CMakeLists.txt +++ b/src/pad/CMakeLists.txt @@ -71,3 +71,5 @@ target_link_libraries(pad messages( TARGET pad ) + +add_subdirectory(test) diff --git a/src/pad/test/CMakeLists.txt b/src/pad/test/CMakeLists.txt new file mode 100644 index 00000000000..7d40e790171 --- /dev/null +++ b/src/pad/test/CMakeLists.txt @@ -0,0 +1,32 @@ +include("openroad") + +set(TEST_NAMES + bump_array_make + bump_array_remove + bump_array_remove_single + make_corner_sites + make_io_sites + non_top_layer + place_pad + place_pad_outsideofrow + place_bondpad + place_bondpad_stagger + place_pad_no_master + place_pad_wrong_master + assign_bumps + connect_by_abutment + rdl_route + rdl_route_failed + rdl_route_assignments + rdl_route_45 + rdl_route_45_cost + rdl_route_via + rdl_route_bump_via + skywater130_overlapping_filler + skywater130_caravel + skywater130_coyote_tc +) + +foreach(TEST_NAME IN LISTS TEST_NAMES) + or_integration_test("pad" ${TEST_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/regression) +endforeach() diff --git a/src/par/CMakeLists.txt b/src/par/CMakeLists.txt index e4e72917164..da78b853f76 100644 --- a/src/par/CMakeLists.txt +++ b/src/par/CMakeLists.txt @@ -157,3 +157,5 @@ if (Python3_FOUND AND BUILD_PYTHON) ) endif() + +add_subdirectory(test) \ No newline at end of file diff --git a/src/par/test/CMakeLists.txt b/src/par/test/CMakeLists.txt new file mode 100644 index 00000000000..5edfb1d75dc --- /dev/null +++ b/src/par/test/CMakeLists.txt @@ -0,0 +1,10 @@ +include("openroad") + +set(TEST_NAMES + read_part + partition_gcd +) + +foreach(TEST_NAME IN LISTS TEST_NAMES) + or_integration_test("par" ${TEST_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/regression) +endforeach() diff --git a/src/pdn/CMakeLists.txt b/src/pdn/CMakeLists.txt index 89d322ee53d..9f8a240b934 100644 --- a/src/pdn/CMakeLists.txt +++ b/src/pdn/CMakeLists.txt @@ -34,3 +34,4 @@ ############################################################################### add_subdirectory(src) +add_subdirectory(test) \ No newline at end of file diff --git a/src/pdn/test/CMakeLists.txt b/src/pdn/test/CMakeLists.txt new file mode 100644 index 00000000000..eb53ff631af --- /dev/null +++ b/src/pdn/test/CMakeLists.txt @@ -0,0 +1,99 @@ +include("openroad") + +set(TEST_NAMES + reset + report + ripup + convert + names + min_width + max_width + min_spacing + widthtable + design_width + offgrid + core_grid + core_grid_with_rings + core_grid_start_power + core_grid_start_power_strap_ground + core_grid_with_rings_with_straps + core_grid_dual_followpins + core_grid_dual_followpins_error + core_grid_with_dual_rings + core_grid_with_rings_connect + core_grid_cut_pitch + core_grid_snap + core_grid_via_snap + core_grid_split_cuts + core_grid_with_rings_with_straps_rings_over_core + core_grid_with_routing_obstructions + core_grid_adjacentcuts + core_grid_obstruction + core_grid_auto_domain + core_grid_auto_domain_multiple_nets + core_grid_extend_to_boundary + core_grid_extend_to_boundary_no_pins + core_grid_with_M7_pins + core_grid_with_M6_min_area + core_grid_strap_count + core_grid_no_trim + core_grid_offset_strap + core_grid_with_rings_with_limit_straps + core_grid_failed_via_report + macros + macros_with_halo + macros_cells + macros_cells_orient + macros_with_rings + macros_narrow_channel + macros_narrow_channel_large_spacing + macros_narrow_channel_repair_overlap + macros_add_twice + macros_cells_extend_boundary + macros_cells_no_grid + macros_narrow_channel_jog + macros_different_nets + macros_grid_through + macros_grid_through_without_middle + macros_cells_dont_touch + macros_cells_overlapping_ports + macros_cells_not_fixed + macros_cells_via_failure + region_temp_sensor + region_secondary_nets + region_non_rect + pads_black_parrot + pads_black_parrot_offset + pads_black_parrot_no_connect + pads_black_parrot_limit_connect + pads_black_parrot_flipchip + pads_black_parrot_flipchip_connect_bumps + pads_black_parrot_flipchip_connect_overpads + pads_black_parrot_max_width + asap7_vias + asap7_vias_cutclass + asap7_no_via_generate + asap7_vias_arrayspacing + asap7_vias_arrayspacing_notfirst + asap7_vias_arrayspacing_partial + asap7_vias_arrayspacing_3_layer + asap7_vias_max_rows_columns + asap7_vias_dont_use + asap7_taper + asap7_offcenter_via + asap7_no_via_generate_v1_snapped + asap7_failed_macro_grid + asap7_vias_fixed_vias + existing + power_switch + power_switch_star + power_switch_daisy + power_switch_regions + power_switch_cut_rows + repair_vias + sroute_test +) + +foreach(TEST_NAME IN LISTS TEST_NAMES) + or_integration_test("pdn" ${TEST_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/regression) +endforeach() diff --git a/src/ppl/CMakeLists.txt b/src/ppl/CMakeLists.txt index 1d5c42c955e..97a94fdb378 100644 --- a/src/ppl/CMakeLists.txt +++ b/src/ppl/CMakeLists.txt @@ -99,3 +99,5 @@ if (Python3_FOUND AND BUILD_PYTHON) ) endif() + +add_subdirectory(test) \ No newline at end of file diff --git a/src/ppl/test/CMakeLists.txt b/src/ppl/test/CMakeLists.txt new file mode 100644 index 00000000000..912f2e615ad --- /dev/null +++ b/src/ppl/test/CMakeLists.txt @@ -0,0 +1,120 @@ +include("openroad") + +set(TEST_NAMES + add_constraint_debug + add_constraint1 + add_constraint2 + add_constraint3 + add_constraint4 + add_constraint5 + add_constraint6 + add_constraint7 + add_constraint8 + add_constraint9 + add_constraint10 + add_constraint11 + add_constraint12 + add_constraint13 + add_constraint14 + add_constraint15 + add_constraint16 + add_constraint_error1 + add_constraint_error2 + add_constraint_error3 + add_constraint_error4 + add_constraint_error5 + add_constraint_error6 + add_constraint_error7 + annealing1 + annealing2 + annealing3 + annealing4 + annealing_constraint1 + annealing_constraint2 + annealing_constraint3 + annealing_constraint4 + annealing_constraint5 + annealing_constraint6 + annealing_constraint7 + annealing_constraint8 + annealing_large_groups1 + annealing_large_groups2 + annealing_mirrored1 + annealing_mirrored2 + annealing_mirrored3 + annealing_mirrored4 + annealing_mirrored5 + blocked_region + cells_not_placed + exclude1 + exclude2 + exclude3 + gcd + group_pins1 + group_pins2 + group_pins3 + group_pins4 + group_pins5 + group_pins6 + group_pins7 + group_pins8 + group_pins9 + group_pins10 + group_pins_error1 + group_pins_warn1 + invalid_layer + large_groups1 + large_groups2 + large_groups3 + large_groups4 + macro_not_placed + macro_not_placed_random + min_dist_in_tracks1 + min_dist_in_tracks2 + multi_layers + multiple_calls + no_instance_pins + no_pins + no_tracks + on_grid + pin_length + pin_length_error + pin_extension + pin_thick_multiplier + place_pin1 + place_pin2 + place_pin3 + place_pin4 + place_pin5 + place_pin6 + place_pin7 + place_pin_error1 + place_pin_error2 + place_pin_error3 + random1 + random2 + random3 + random4 + random5 + random6 + random7 + random8 + random9 + top_layer1 + top_layer2 + top_layer3 + top_layer4 + top_layer5 + top_layer6 + top_layer7 + top_layer_error + top_layer_error2 + write_pin_placement1 + write_pin_placement2 + write_pin_placement3 + write_pin_placement4 +) + +foreach(TEST_NAME IN LISTS TEST_NAMES) + or_integration_test("ppl" ${TEST_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/regression) +endforeach() diff --git a/src/psm/CMakeLists.txt b/src/psm/CMakeLists.txt index ac311bb40ce..950e20afd0d 100644 --- a/src/psm/CMakeLists.txt +++ b/src/psm/CMakeLists.txt @@ -30,3 +30,4 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. add_subdirectory(src) +add_subdirectory(test) \ No newline at end of file diff --git a/src/psm/test/CMakeLists.txt b/src/psm/test/CMakeLists.txt new file mode 100644 index 00000000000..cc9492b5d0c --- /dev/null +++ b/src/psm/test/CMakeLists.txt @@ -0,0 +1,32 @@ +include("openroad") + +set(TEST_NAMES + aes_test_vdd + aes_test_vdd_set_node_density + aes_test_vdd_set_node_density_fact + aes_test_vss + gcd_test_vdd + gcd_no_vsrc + gcd_write_sp_test_vdd + gcd_em_test_vdd + gcd_all_vss + gcd_vss_no_vsrc + gcd_sky130_vdd + aes_asap7_vdd + check_power_grid + check_power_grid_disconnected + check_power_grid_ok_disconnected + check_power_grid_macros + check_power_grid_disconnected_macro + corners + aes_test_bterms + aes_test_multiple_bterms + zerosoc_pads + zerosoc_pads_check_only + zerosoc_pads_check_only_disconnected + pad_connected_by_abutment +) + +foreach(TEST_NAME IN LISTS TEST_NAMES) + or_integration_test("psm" ${TEST_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/regression) +endforeach() diff --git a/src/rcx/CMakeLists.txt b/src/rcx/CMakeLists.txt index 2824ff8c8dd..346aeb71584 100644 --- a/src/rcx/CMakeLists.txt +++ b/src/rcx/CMakeLists.txt @@ -35,3 +35,5 @@ project(OpenRCX VERSION 0.0.1 LANGUAGES CXX) add_subdirectory(src) +add_subdirectory(test) + diff --git a/src/rcx/test/CMakeLists.txt b/src/rcx/test/CMakeLists.txt new file mode 100644 index 00000000000..c503d9e70fb --- /dev/null +++ b/src/rcx/test/CMakeLists.txt @@ -0,0 +1,13 @@ +include("openroad") + +set(TEST_NAMES + generate_pattern + ext_pattern + gcd + 45_gcd + names +) + +foreach(TEST_NAME IN LISTS TEST_NAMES) + or_integration_test("rcx" ${TEST_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/regression) +endforeach() \ No newline at end of file diff --git a/src/rmp/CMakeLists.txt b/src/rmp/CMakeLists.txt index 89d322ee53d..9f8a240b934 100644 --- a/src/rmp/CMakeLists.txt +++ b/src/rmp/CMakeLists.txt @@ -34,3 +34,4 @@ ############################################################################### add_subdirectory(src) +add_subdirectory(test) \ No newline at end of file diff --git a/src/rmp/test/CMakeLists.txt b/src/rmp/test/CMakeLists.txt new file mode 100644 index 00000000000..c420457d9df --- /dev/null +++ b/src/rmp/test/CMakeLists.txt @@ -0,0 +1,18 @@ +include("openroad") + +set(TEST_NAMES + gcd_restructure + const_cell_removal + blif_writer + blif_writer_input_output + blif_writer_consts + blif_writer_hanging + blif_writer_sequential + blif_reader + blif_reader_const + blif_reader_sequential +) + +foreach(TEST_NAME IN LISTS TEST_NAMES) + or_integration_test("rmp" ${TEST_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/regression) +endforeach() \ No newline at end of file diff --git a/src/rsz/CMakeLists.txt b/src/rsz/CMakeLists.txt index 84335f37c92..a2117215a10 100644 --- a/src/rsz/CMakeLists.txt +++ b/src/rsz/CMakeLists.txt @@ -34,3 +34,4 @@ ############################################################################### add_subdirectory(src) +add_subdirectory(test) \ No newline at end of file diff --git a/src/rsz/test/CMakeLists.txt b/src/rsz/test/CMakeLists.txt new file mode 100644 index 00000000000..761008eb2a4 --- /dev/null +++ b/src/rsz/test/CMakeLists.txt @@ -0,0 +1,118 @@ +include("openroad") + +set(TEST_NAMES + buffer_ports1 + buffer_ports3 + buffer_ports4 + buffer_ports5 + buffer_ports6 + buffer_ports7 + buffer_ports8 + buffer_varying_lengths + eqy_repair_setup2 + eqy_repair_setup5 + fanin_fanout1 + make_parasitics1 + make_parasitics2 + make_parasitics3 + make_parasitics4 + make_parasitics5 + make_parasitics6 + pin_swap1 + resize1 + resize4 + resize5 + resize6 + resize_slack1 + resize_slack2 + resize_slack3 + remove_buffers1 + remove_buffers2 + repair_clk_nets1 + repair_clk_inverters1 + repair_cap1 + repair_cap2 + repair_cap3 + repair_design1 + repair_design2 + repair_design3 + repair_design4 + repair_design5 + repair_fanout1 + repair_fanout2 + repair_fanout3 + repair_fanout4 + repair_fanout5 + repair_fanout6 + repair_fanout7 + repair_fanout8 + repair_hold1 + repair_hold2 + repair_hold3 + repair_hold4 + repair_hold5 + repair_hold6 + repair_hold7 + repair_hold8 + repair_hold9 + repair_hold10 + repair_hold11 + repair_hold12 + repair_hold13 + repair_hold14 + repair_setup1 + repair_setup2 + repair_setup3 + repair_setup4 + repair_setup5 + repair_setup6 + repair_slew1 + repair_slew2 + repair_slew3 + repair_slew4 + repair_slew5 + repair_slew6 + repair_slew7 + repair_slew8 + repair_slew9 + repair_slew10 + repair_slew11 + repair_slew12 + repair_slew13 + repair_slew14 + repair_slew15 + repair_slew16 + repair_slew17 + report_floating_nets1 + report_floating_nets2 + report_floating_nets3 + repair_tie1 + repair_tie2 + repair_tie3 + repair_tie4 + repair_tie5 + repair_tie6 + repair_tie7 + repair_tie8 + repair_wire1 + repair_wire2 + repair_wire3 + repair_wire4 + repair_wire5 + repair_wire6 + repair_wire7 + repair_wire8 + repair_wire9 + repair_wire10 + repair_wire11 + gcd_resize + repair_design3_verbose + repair_setup4_verbose + repair_hold9_verbose + set_dont_touch1 + set_dont_use1 +) + +foreach(TEST_NAME IN LISTS TEST_NAMES) + or_integration_test("rsz" ${TEST_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/regression) +endforeach() \ No newline at end of file diff --git a/src/stt/CMakeLists.txt b/src/stt/CMakeLists.txt index 8c51043ae4d..9664a6297e2 100644 --- a/src/stt/CMakeLists.txt +++ b/src/stt/CMakeLists.txt @@ -126,3 +126,5 @@ if (Python3_FOUND AND BUILD_PYTHON) ) endif() + +add_subdirectory(test) \ No newline at end of file diff --git a/src/stt/test/CMakeLists.txt b/src/stt/test/CMakeLists.txt new file mode 100644 index 00000000000..19dc39e808c --- /dev/null +++ b/src/stt/test/CMakeLists.txt @@ -0,0 +1,15 @@ +include("openroad") + +set(TEST_NAMES + flute1 + flute_gcd + check + parse_clocks + pd1 + pd2 + pd_gcd +) + +foreach(TEST_NAME IN LISTS TEST_NAMES) + or_integration_test("stt" ${TEST_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/regression) +endforeach() \ No newline at end of file diff --git a/src/tap/CMakeLists.txt b/src/tap/CMakeLists.txt index 51490fcf276..4411cf92e2e 100644 --- a/src/tap/CMakeLists.txt +++ b/src/tap/CMakeLists.txt @@ -33,4 +33,5 @@ ## POSSIBILITY OF SUCH DAMAGE. ################################################################################ -add_subdirectory(src) \ No newline at end of file +add_subdirectory(src) +add_subdirectory(test) \ No newline at end of file diff --git a/src/tap/test/CMakeLists.txt b/src/tap/test/CMakeLists.txt new file mode 100644 index 00000000000..6ddddaa41f0 --- /dev/null +++ b/src/tap/test/CMakeLists.txt @@ -0,0 +1,29 @@ +include("openroad") + +set(TEST_NAMES + disallow_one_site_gaps + gcd_fakeram + gcd_nangate45 + gcd_sky130 + gcd_asap7 + invalid_cells + multiple_calls + avoid_overlap + boundary_macros + gcd_prefix + gcd_ripup + no_endcap + symmetry + cut_rows + cut_rows_with_endcaps + boundary_macros_separate + boundary_macros_auto_select + boundary_macros_tapcell + gcd_sky130_separate + jpeg_gf180 + aes_gf180 +) + +foreach(TEST_NAME IN LISTS TEST_NAMES) + or_integration_test("tap" ${TEST_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/regression) +endforeach() \ No newline at end of file diff --git a/src/upf/CMakeLists.txt b/src/upf/CMakeLists.txt index ed491fa4d90..95d7593beec 100644 --- a/src/upf/CMakeLists.txt +++ b/src/upf/CMakeLists.txt @@ -29,4 +29,5 @@ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. -add_subdirectory(src) \ No newline at end of file +add_subdirectory(src) +add_subdirectory(test) \ No newline at end of file diff --git a/src/upf/test/CMakeLists.txt b/src/upf/test/CMakeLists.txt new file mode 100644 index 00000000000..ef6120f8f1b --- /dev/null +++ b/src/upf/test/CMakeLists.txt @@ -0,0 +1,10 @@ +include("openroad") + +set(TEST_NAMES + upf_test + levelshifter +) + +foreach(TEST_NAME IN LISTS TEST_NAMES) + or_integration_test("upf" ${TEST_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/regression) +endforeach() \ No newline at end of file diff --git a/src/utl/CMakeLists.txt b/src/utl/CMakeLists.txt index 162e96e3252..be9a032e21e 100644 --- a/src/utl/CMakeLists.txt +++ b/src/utl/CMakeLists.txt @@ -131,3 +131,5 @@ if(ENABLE_TESTS) utl ) endif() + +add_subdirectory(test) \ No newline at end of file diff --git a/src/utl/test/CMakeLists.txt b/src/utl/test/CMakeLists.txt new file mode 100644 index 00000000000..32edda1791f --- /dev/null +++ b/src/utl/test/CMakeLists.txt @@ -0,0 +1,12 @@ +include("openroad") + +set(TEST_NAMES +test_info + test_error + test_suppress_message + test_metrics +) + +foreach(TEST_NAME IN LISTS TEST_NAMES) + or_integration_test("utl" ${TEST_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/regression) +endforeach() \ No newline at end of file diff --git a/test/regression_vars.tcl b/test/regression_vars.tcl index d7cb4712ef7..a013bbb6c9f 100644 --- a/test/regression_vars.tcl +++ b/test/regression_vars.tcl @@ -29,6 +29,9 @@ set app_options "-no_init -no_splash -exit" set result_dir [file join $test_dir "results"] # Collective diffs. set diff_file [file join $result_dir "diffs"] +if { [info exist ::env(DIFF_LOCATION)] } { + set diff_file "$::env(DIFF_LOCATION)" +} # File containing list of failed tests. set failure_file [file join $result_dir "failures"] # Use the DIFF_OPTIONS envar to change the diff options From 30eb33463514d9bdcc248c8a93d583dd2801653f Mon Sep 17 00:00:00 2001 From: Ethan Mahintorabi Date: Tue, 12 Mar 2024 00:28:05 +0000 Subject: [PATCH 2/9] make ctest unreliant on test names regression_vars Signed-off-by: Ethan Mahintorabi --- CMakeLists.txt | 3 ++- test/regression_vars.tcl | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0eba46bc15a..b3995631f8b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -149,8 +149,9 @@ function(or_integration_test tool_name test_name regression_binary) add_test ( NAME ${tool_name}.${test_name} COMMAND ${BASH_PROGRAM} ${regression_binary} ${test_name} + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} ) - set_property(TEST ${tool_name}.${test_name} PROPERTY ENVIRONMENT "DIFF_LOCATION=${CMAKE_CURRENT_LIST_DIR}/results/${test_name}.diff") + set_property(TEST ${tool_name}.${test_name} PROPERTY ENVIRONMENT "TEST_TYPE=compare_logfile;CTEST_TESTNAME=${test_name};DIFF_LOCATION=${CMAKE_CURRENT_LIST_DIR}/results/${test_name}.diff") set_tests_properties(${tool_name}.${test_name} PROPERTIES LABELS "IntegrationTest") endfunction() # End Integration Test Macro diff --git a/test/regression_vars.tcl b/test/regression_vars.tcl index a013bbb6c9f..d22026d1ec8 100644 --- a/test/regression_vars.tcl +++ b/test/regression_vars.tcl @@ -72,6 +72,10 @@ proc record_flow_tests { tests } { proc record_tests1 { tests cmp_logfile } { global test_dir + if { [info exist ::env(CTEST_TESTNAME)]} { + set tests "$::env(CTEST_TESTNAME)" + set cmp_logfile "$::env(TEST_TYPE)" + } foreach test $tests { # Prune commented tests from the list. if { [string index $test 0] != "#" } { From fcf540b0974f2c9edc4726977b7434faeccdcaa8 Mon Sep 17 00:00:00 2001 From: Matt Liberty Date: Thu, 14 Mar 2024 14:05:19 -0700 Subject: [PATCH 3/9] Split out testing.cmake Signed-off-by: Matt Liberty --- CMakeLists.txt | 16 ++-------------- src/cmake/openroad.cmake | 1 + src/cmake/testing.cmake | 19 +++++++++++++++++++ 3 files changed, 22 insertions(+), 14 deletions(-) create mode 100644 src/cmake/testing.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index b3995631f8b..faddf8797a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -142,23 +142,11 @@ configure_file( # Ask CMake to output a compile_commands.json file for use with things like clang-tidy set(CMAKE_EXPORT_COMPILE_COMMANDS 1) -# Integration Test Macro -find_program (BASH_PROGRAM bash REQUIRED) - -function(or_integration_test tool_name test_name regression_binary) - add_test ( - NAME ${tool_name}.${test_name} - COMMAND ${BASH_PROGRAM} ${regression_binary} ${test_name} - WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} - ) - set_property(TEST ${tool_name}.${test_name} PROPERTY ENVIRONMENT "TEST_TYPE=compare_logfile;CTEST_TESTNAME=${test_name};DIFF_LOCATION=${CMAKE_CURRENT_LIST_DIR}/results/${test_name}.diff") - set_tests_properties(${tool_name}.${test_name} PROPERTIES LABELS "IntegrationTest") -endfunction() -# End Integration Test Macro - add_subdirectory(third-party) if(ENABLE_TESTS) + find_program (BASH_PROGRAM bash REQUIRED) + enable_testing() add_custom_target(build_and_test ${CMAKE_CTEST_COMMAND} --parallel --output-on-failure -LE IntegrationTest) include(GoogleTest) diff --git a/src/cmake/openroad.cmake b/src/cmake/openroad.cmake index 07a5681f92a..fbedafa34de 100644 --- a/src/cmake/openroad.cmake +++ b/src/cmake/openroad.cmake @@ -1,2 +1,3 @@ include("swig_lib") include("messages") +include("testing") diff --git a/src/cmake/testing.cmake b/src/cmake/testing.cmake new file mode 100644 index 00000000000..f51a0d4b13e --- /dev/null +++ b/src/cmake/testing.cmake @@ -0,0 +1,19 @@ +function(or_integration_test tool_name test_name regression_binary) + add_test ( + NAME ${tool_name}.${test_name} + COMMAND ${BASH_PROGRAM} ${regression_binary} ${test_name} + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + ) + + set(CONCAT ENV + "TEST_TYPE=compare_logfile;" + "CTEST_TESTNAME=${test_name};" + "DIFF_LOCATION=${CMAKE_CURRENT_LIST_DIR}/results/${test_name}.diff" + ) + + set_property(TEST ${tool_name}.${test_name} + PROPERTY ENVIRONMENT ${ENV}) + + set_tests_properties(${tool_name}.${test_name} + PROPERTIES LABELS "IntegrationTest") +endfunction() From 705f34596204fe3e6c57603dea80cd75b0604650 Mon Sep 17 00:00:00 2001 From: Matt Liberty Date: Thu, 14 Mar 2024 14:18:07 -0700 Subject: [PATCH 4/9] pdn: correct core_grid_with_rings_connect result filename Signed-off-by: Matt Liberty --- src/pdn/test/core_grid_with_rings_connect.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pdn/test/core_grid_with_rings_connect.tcl b/src/pdn/test/core_grid_with_rings_connect.tcl index b01b3710b66..f0639ed2698 100644 --- a/src/pdn/test/core_grid_with_rings_connect.tcl +++ b/src/pdn/test/core_grid_with_rings_connect.tcl @@ -19,6 +19,6 @@ add_pdn_connect -layers {metal1 metal6} pdngen -set def_file [make_result_file core_grid_with_rings.def] +set def_file [make_result_file core_grid_with_rings_connect.def] write_def $def_file diff_files core_grid_with_rings.defok $def_file From 35e09a69ec68a1c302899264809cc45188289986 Mon Sep 17 00:00:00 2001 From: Matt Liberty Date: Thu, 14 Mar 2024 14:18:36 -0700 Subject: [PATCH 5/9] gpl: correct test_name in test/simple01-uniform Signed-off-by: Matt Liberty --- src/gpl/test/simple01-uniform.tcl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gpl/test/simple01-uniform.tcl b/src/gpl/test/simple01-uniform.tcl index a6235d48f47..e067792e923 100644 --- a/src/gpl/test/simple01-uniform.tcl +++ b/src/gpl/test/simple01-uniform.tcl @@ -1,9 +1,9 @@ source helpers.tcl -set test_name simple01 +set test_name simple01-uniform read_lef ./nangate45.lef read_def ./$test_name.def global_placement -init_density_penalty 0.01 -skip_initial_place -density uniform -set def_file [make_result_file $test_name-uniform.def] +set def_file [make_result_file $test_name.def] write_def $def_file -diff_file $def_file $test_name-uniform.defok +diff_file $def_file $test_name.defok From 1d2e2ccb7d73223dc6b66a9025563367e74463a8 Mon Sep 17 00:00:00 2001 From: Matt Liberty Date: Thu, 14 Mar 2024 14:19:59 -0700 Subject: [PATCH 6/9] pdn: in macros_cells_via_failure write rpt in results Signed-off-by: Matt Liberty --- src/pdn/test/macros_cells_via_failure.tcl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pdn/test/macros_cells_via_failure.tcl b/src/pdn/test/macros_cells_via_failure.tcl index eb6400aaabb..07fe72693cd 100644 --- a/src/pdn/test/macros_cells_via_failure.tcl +++ b/src/pdn/test/macros_cells_via_failure.tcl @@ -49,7 +49,8 @@ add_pdn_stripe -grid {CORE_macro_grid_2} -layer {metal6} -width {0.93} -pitch {4 add_pdn_connect -grid {CORE_macro_grid_2} -layers {metal4 metal6} add_pdn_connect -grid {CORE_macro_grid_2} -layers {metal6 metal7} -pdngen -failed_via_report test.rpt +set rpt_file [make_result_file macros_cells_via_failure_test.rpt] +pdngen -failed_via_report $rpt_file set def_file [make_result_file macros_cells_via_failure.def] write_def $def_file From 2a06205982718068b5265d504d0297b9ccf2f3e6 Mon Sep 17 00:00:00 2001 From: Matt Liberty Date: Thu, 14 Mar 2024 14:26:18 -0700 Subject: [PATCH 7/9] gpl: add symlink for simple01-uniform.def Signed-off-by: Matt Liberty --- src/gpl/test/simple01-uniform.def | 1 + 1 file changed, 1 insertion(+) create mode 120000 src/gpl/test/simple01-uniform.def diff --git a/src/gpl/test/simple01-uniform.def b/src/gpl/test/simple01-uniform.def new file mode 120000 index 00000000000..7c6bf5ed94f --- /dev/null +++ b/src/gpl/test/simple01-uniform.def @@ -0,0 +1 @@ +simple01.def \ No newline at end of file From f41936731f8ff945a63f70834e2a10bec9814ce4 Mon Sep 17 00:00:00 2001 From: Matt Liberty Date: Thu, 14 Mar 2024 15:22:04 -0700 Subject: [PATCH 8/9] fix bug in testing.cmake Signed-off-by: Matt Liberty --- src/cmake/testing.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmake/testing.cmake b/src/cmake/testing.cmake index f51a0d4b13e..7b74a4e8fc2 100644 --- a/src/cmake/testing.cmake +++ b/src/cmake/testing.cmake @@ -5,7 +5,7 @@ function(or_integration_test tool_name test_name regression_binary) WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} ) - set(CONCAT ENV + string(CONCAT ENV "TEST_TYPE=compare_logfile;" "CTEST_TESTNAME=${test_name};" "DIFF_LOCATION=${CMAKE_CURRENT_LIST_DIR}/results/${test_name}.diff" From 9889bee83c91666057cce580c4a2747b78bfd265 Mon Sep 17 00:00:00 2001 From: Matt Liberty Date: Thu, 14 Mar 2024 15:55:52 -0700 Subject: [PATCH 9/9] dst: disable dst.TestDistributed Signed-off-by: Matt Liberty --- src/dst/test/cpp/CMakeLists.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/dst/test/cpp/CMakeLists.txt b/src/dst/test/cpp/CMakeLists.txt index c23bb8a8218..0beb1e33b16 100644 --- a/src/dst/test/cpp/CMakeLists.txt +++ b/src/dst/test/cpp/CMakeLists.txt @@ -39,13 +39,14 @@ add_test( COMMAND TestBalancer ) -add_test( - NAME "dst.TestDistributed" - COMMAND TestDistributed -) +# This test case appears to have an internal race condition +#add_test( +# NAME "dst.TestDistributed" +# COMMAND TestDistributed +#) add_dependencies(build_and_test TestWorker TestBalancer TestDistributed -) \ No newline at end of file +)