Skip to content

Commit

Permalink
Merge pull request The-OpenROAD-Project#4766 from QuantamHD/ctest_ftw
Browse files Browse the repository at this point in the history
meta: Moving tool tests to ctest
  • Loading branch information
maliberty authored Mar 15, 2024
2 parents 1609be4 + 9889bee commit 54b5934
Show file tree
Hide file tree
Showing 60 changed files with 1,022 additions and 51 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +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)



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)
Expand Down
1 change: 1 addition & 0 deletions src/ant/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@
# POSSIBILITY OF SUCH DAMAGE.

add_subdirectory(src)
add_subdirectory(test)
13 changes: 13 additions & 0 deletions src/ant/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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()
1 change: 1 addition & 0 deletions src/cmake/openroad.cmake
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
include("swig_lib")
include("messages")
include("testing")
19 changes: 19 additions & 0 deletions src/cmake/testing.cmake
Original file line number Diff line number Diff line change
@@ -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}
)

string(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()
26 changes: 26 additions & 0 deletions src/cts/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/dbSta/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@
###############################################################################

add_subdirectory(src)
add_subdirectory(test)
45 changes: 45 additions & 0 deletions src/dbSta/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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()
2 changes: 1 addition & 1 deletion src/dft/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
15 changes: 14 additions & 1 deletion src/dft/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
68 changes: 68 additions & 0 deletions src/dpl/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/dpo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,5 @@ if (Python3_FOUND AND BUILD_PYTHON)
)

endif()

add_subdirectory(test)
15 changes: 15 additions & 0 deletions src/dpo/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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()
2 changes: 2 additions & 0 deletions src/drt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -257,3 +257,5 @@ if (Python3_FOUND AND BUILD_PYTHON)
)

endif()

add_subdirectory(test)
18 changes: 18 additions & 0 deletions src/drt/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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()
22 changes: 22 additions & 0 deletions src/dst/test/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,25 @@ target_include_directories(TestDistributed
${DST_HOME}/src
${OPENROAD_HOME}/include
)

add_test(
NAME "dst.TestWorker"
COMMAND TestWorker
)

add_test(
NAME "dst.TestBalancer"
COMMAND TestBalancer
)

# 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
)
2 changes: 2 additions & 0 deletions src/fin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,5 @@ if (Python3_FOUND AND BUILD_PYTHON)
)

endif()

add_subdirectory(test)
9 changes: 9 additions & 0 deletions src/fin/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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()
Loading

0 comments on commit 54b5934

Please sign in to comment.