diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 84684fe..77b13cb 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -38,4 +38,4 @@ jobs: mkdir build cd build cmake -DSOCMAKE_BUILD_TESTING=TRUE ../ - make check + make check_cdash diff --git a/CTestConfig.cmake b/CTestConfig.cmake new file mode 100644 index 0000000..d1c139f --- /dev/null +++ b/CTestConfig.cmake @@ -0,0 +1,20 @@ +## This file should be placed in the root directory of your project. +## Then modify the CMakeLists.txt file in the root directory of your +## project to incorporate the testing dashboard. +## +## # The following are required to submit to the CDash dashboard: +## ENABLE_TESTING() +## INCLUDE(CTest) + +set(CTEST_PROJECT_NAME SoCMake) +set(CTEST_NIGHTLY_START_TIME 01:00:00 UTC) + +if(CMAKE_VERSION VERSION_GREATER 3.14) + set(CTEST_SUBMIT_URL https://my.cdash.org/submit.php?project=SoCMake) +else() + set(CTEST_DROP_METHOD "https") + set(CTEST_DROP_SITE "my.cdash.org") + set(CTEST_DROP_LOCATION "/submit.php?project=SoCMake") +endif() + +set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index f079504..ca5c2f8 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,5 +1,16 @@ +cmake_minimum_required(VERSION 3.25) +project(SoCMake_testing) + +include(CTest) + add_custom_target(check COMMAND ctest $(JOBS) --output-on-failure + WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/../ + ) + +add_custom_target(check_cdash + COMMAND ctest -D Nightly $(JOBS) --output-on-failure + WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/../ ) add_subdirectory(iverilog) diff --git a/tests/iverilog/CMakeLists.txt b/tests/iverilog/CMakeLists.txt index 85af082..08da783 100644 --- a/tests/iverilog/CMakeLists.txt +++ b/tests/iverilog/CMakeLists.txt @@ -1,25 +1,2 @@ -cmake_minimum_required(VERSION 3.25) -project(iverilog_simple_test NONE) - -add_ip(iverilog_simple_test - VENDOR tests - LIBRARY iverilog - VERSION 1.2.3 - ) - -ip_sources(${IP} VERILOG - ${PROJECT_SOURCE_DIR}/tb.v - ) - -ip_compile_definitions(${IP} VERILOG SOME_DEF1=100) -ip_include_directories(${IP} VERILOG ${PROJECT_SOURCE_DIR}/inc) - -iverilog(${IP} - EXECUTABLE ${PROJECT_BINARY_DIR}/tb - ) - -include(CTest) - -add_test(NAME ${PROJECT_NAME} COMMAND ${PROJECT_BINARY_DIR}/tb) - -add_dependencies(check ${IP}_iverilog) +add_subdirectory(iverilog_simple_test) +add_subdirectory(iverilog_multi_top) diff --git a/tests/iverilog/iverilog_multi_top/CMakeLists.txt b/tests/iverilog/iverilog_multi_top/CMakeLists.txt new file mode 100644 index 0000000..83bbe47 --- /dev/null +++ b/tests/iverilog/iverilog_multi_top/CMakeLists.txt @@ -0,0 +1,25 @@ +cmake_minimum_required(VERSION 3.25) +project(iverilog_multi_top NONE) + +add_ip(iverilog_multi_top + VENDOR tests + LIBRARY iverilog + VERSION 1 + ) + +ip_sources(${IP} VERILOG + ${PROJECT_SOURCE_DIR}/top1.v + ${PROJECT_SOURCE_DIR}/top2.v + ) + +iverilog(${IP} + TOP_MODULE top2 + EXECUTABLE ${PROJECT_BINARY_DIR}/tb + ) + +include(CTest) + +add_test(NAME ${PROJECT_NAME} COMMAND ${PROJECT_BINARY_DIR}/tb) + +add_dependencies(check ${IP}_iverilog) +add_dependencies(check_cdash ${IP}_iverilog) diff --git a/tests/iverilog/inc/header.vh b/tests/iverilog/iverilog_multi_top/inc/header.vh similarity index 100% rename from tests/iverilog/inc/header.vh rename to tests/iverilog/iverilog_multi_top/inc/header.vh diff --git a/tests/iverilog/iverilog_multi_top/top1.v b/tests/iverilog/iverilog_multi_top/top1.v new file mode 100644 index 0000000..10312c1 --- /dev/null +++ b/tests/iverilog/iverilog_multi_top/top1.v @@ -0,0 +1,6 @@ +module top1; + initial begin + $display("Module top1\n"); + $fatal(); + end +endmodule diff --git a/tests/iverilog/iverilog_multi_top/top2.v b/tests/iverilog/iverilog_multi_top/top2.v new file mode 100644 index 0000000..6456bb2 --- /dev/null +++ b/tests/iverilog/iverilog_multi_top/top2.v @@ -0,0 +1,7 @@ +module top2; + initial begin + $display("Module top2\n"); + $finish(); + end +endmodule + diff --git a/tests/iverilog/iverilog_simple_test/CMakeLists.txt b/tests/iverilog/iverilog_simple_test/CMakeLists.txt new file mode 100644 index 0000000..03cc0bd --- /dev/null +++ b/tests/iverilog/iverilog_simple_test/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.25) +project(iverilog_simple_test NONE) + +add_ip(iverilog_simple_test + VENDOR tests + LIBRARY iverilog + VERSION 1.2.3 + ) + +ip_sources(${IP} VERILOG + ${PROJECT_SOURCE_DIR}/tb.v + ) + +ip_compile_definitions(${IP} VERILOG SOME_DEF1=100) +ip_include_directories(${IP} VERILOG ${PROJECT_SOURCE_DIR}/inc) + +iverilog(${IP} + EXECUTABLE ${PROJECT_BINARY_DIR}/tb + ) + +include(CTest) + +add_test(NAME ${PROJECT_NAME} COMMAND ${PROJECT_BINARY_DIR}/tb) + +add_dependencies(check ${IP}_iverilog) +add_dependencies(check_cdash ${IP}_iverilog) diff --git a/tests/iverilog/iverilog_simple_test/inc/header.vh b/tests/iverilog/iverilog_simple_test/inc/header.vh new file mode 100644 index 0000000..2e493ca --- /dev/null +++ b/tests/iverilog/iverilog_simple_test/inc/header.vh @@ -0,0 +1 @@ +`define INCLUDED_NUM 55 diff --git a/tests/iverilog/tb.v b/tests/iverilog/iverilog_simple_test/tb.v similarity index 100% rename from tests/iverilog/tb.v rename to tests/iverilog/iverilog_simple_test/tb.v