diff --git a/.github/workflows/regression_test.yml b/.github/workflows/regression_test.yml index 8a248f9f..affb6f61 100644 --- a/.github/workflows/regression_test.yml +++ b/.github/workflows/regression_test.yml @@ -58,6 +58,37 @@ jobs: cmake_path: ./test/cmake/mqtt result_affix: MQTT skip_deploy: true + NetXDuo64: + permissions: + contents: read + issues: read + checks: write + pull-requests: write + pages: write + id-token: write + uses: azure-rtos/threadx/.github/workflows/regression_template.yml@master + with: + build_script: ./scripts/build_nxd64.sh + test_script: ./scripts/test_nxd64.sh + cmake_path: ./test/cmake/netxduo64 + result_affix: NetXDuo64 + skip_deploy: true + NetXDuo_fast: + permissions: + contents: read + issues: read + checks: write + pull-requests: write + pages: write + id-token: write + uses: azure-rtos/threadx/.github/workflows/regression_template.yml@master + with: + build_script: ./scripts/build_nxd_fast.sh + test_script: ./scripts/test_nxd_fast.sh + cmake_path: ./test/cmake/netxduo_fast + result_affix: NetXDuo_fast + skip_deploy: true + skip_coverage: true Deploy: permissions: contents: read @@ -66,8 +97,8 @@ jobs: pull-requests: write pages: write id-token: write - needs: [NetXDuo, Web, MQTT] + needs: [NetXDuo, Web, MQTT, NetXDuo64, NetXDuo_fast] uses: azure-rtos/threadx/.github/workflows/regression_template.yml@master with: skip_test: true - deploy_list: "NetXDuo Web MQTT" \ No newline at end of file + deploy_list: "NetXDuo Web MQTT NetXDuo64 NetXDuo_fast" \ No newline at end of file diff --git a/scripts/build_nxd64.sh b/scripts/build_nxd64.sh new file mode 100755 index 00000000..93fc15c1 --- /dev/null +++ b/scripts/build_nxd64.sh @@ -0,0 +1,3 @@ +#! /bin/bash + +$(dirname `realpath $0`)/../test/cmake/netxduo64/run.sh build all diff --git a/scripts/build_nxd_fast.sh b/scripts/build_nxd_fast.sh new file mode 100755 index 00000000..cf9ba54d --- /dev/null +++ b/scripts/build_nxd_fast.sh @@ -0,0 +1,3 @@ +#! /bin/bash + +$(dirname `realpath $0`)/../test/cmake/netxduo_fast/run.sh build all diff --git a/scripts/test_nxd64.sh b/scripts/test_nxd64.sh new file mode 100755 index 00000000..4bac622e --- /dev/null +++ b/scripts/test_nxd64.sh @@ -0,0 +1,3 @@ +#! /bin/bash + +CTEST_PARALLEL_LEVEL=4 $(dirname `realpath $0`)/../test/cmake/netxduo64/run.sh test all diff --git a/scripts/test_nxd_fast.sh b/scripts/test_nxd_fast.sh new file mode 100755 index 00000000..94185b79 --- /dev/null +++ b/scripts/test_nxd_fast.sh @@ -0,0 +1,3 @@ +#! /bin/bash + +CTEST_PARALLEL_LEVEL=4 $(dirname `realpath $0`)/../test/cmake/netxduo_fast/run.sh test all diff --git a/test/cmake/netxduo64/CMakeLists.txt b/test/cmake/netxduo64/CMakeLists.txt new file mode 100644 index 00000000..c8e780bf --- /dev/null +++ b/test/cmake/netxduo64/CMakeLists.txt @@ -0,0 +1,47 @@ +cmake_minimum_required(VERSION 3.13 FATAL_ERROR) +cmake_policy(SET CMP0054 NEW) +cmake_policy(SET CMP0057 NEW) +cmake_policy(SET CMP0077 NEW) + +project(netx_test LANGUAGES C) + +set(NX_USER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/nx_user.h) +include(${CMAKE_CURRENT_SOURCE_DIR}/../netxduo/CMakeLists.txt) + +# Set build configurations +set(BUILD_CONFIGURATIONS default_build_coverage) + +get_target_property(SOURCES_LIST netxduo SOURCES) +get_target_property(SOURCE_DIR netxduo SOURCE_DIR) +# Remove files not needed from netxduo +foreach( + EXCLUDE_DIR + nx_secure/src + crypto_libraries/src + addons/auto_ip + addons/cloud + addons/ftp + addons/http + addons/mdns + addons/mqtt + addons/nat + addons/pop3 + addons/ppp + addons/pppoe + addons/ptp + addons/rtp + addons/rtsp + addons/smtp + addons/snmp + addons/sntp + addons/telnet + addons/tftp + addons/web + addons/websocket + utility/iperf) + aux_source_directory(${SOURCE_DIR}/${EXCLUDE_DIR} EXCLUDE_SOURCES) + list(REMOVE_ITEM SOURCES_LIST ${EXCLUDE_SOURCES}) +endforeach() +# list(REMOVE_ITEM SOURCES_LIST ${SOURCE_DIR}/addons/dhcp/nxd_dhcpv6_client.c +# ${SOURCE_DIR}/addons/dhcp/nxd_dhcpv6_server.c) +set_target_properties(netxduo PROPERTIES SOURCES "${SOURCES_LIST}") diff --git a/test/cmake/netxduo64/coverage.sh b/test/cmake/netxduo64/coverage.sh new file mode 100755 index 00000000..6716090c --- /dev/null +++ b/test/cmake/netxduo64/coverage.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -e + +cd $(dirname $0) +mkdir -p coverage_report/$1 +gcovr --object-directory=build/$1/netxduo/CMakeFiles/netxduo.dir/common/src -r ../../../common/src --xml-pretty --output coverage_report/$1.xml +gcovr --object-directory=build/$1/netxduo/CMakeFiles/netxduo.dir/common/src -r ../../../common/src --html --html-details --output coverage_report/$1/index.html diff --git a/test/cmake/netxduo64/libs b/test/cmake/netxduo64/libs new file mode 120000 index 00000000..d4bda9b4 --- /dev/null +++ b/test/cmake/netxduo64/libs @@ -0,0 +1 @@ +../libs \ No newline at end of file diff --git a/test/cmake/netxduo64/nx_user.h b/test/cmake/netxduo64/nx_user.h new file mode 100644 index 00000000..bf9ea058 --- /dev/null +++ b/test/cmake/netxduo64/nx_user.h @@ -0,0 +1,87 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** NetX Component */ +/** */ +/** User Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* nx_user.h PORTABLE C */ +/* 6.0 */ +/* */ +/* AUTHOR */ +/* */ +/* Yuxin Zhou, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains user defines for configuring NetX in specific */ +/* ways. This file will have an effect only if the application and */ +/* NetX library are built with NX_INCLUDE_USER_DEFINE_FILE defined. */ +/* Note that all the defines in this file may also be made on the */ +/* command line when building NetX library and application objects. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 05-19-2020 Yuxin Zhou Initial Version 6.0 */ +/* */ +/**************************************************************************/ + +#ifndef NX_USER_H +#define NX_USER_H + +/* Define the extension to hold the control block for 64-bit mode. */ +#define NX_THREAD_EXTENSION_PTR_SET(a, b) { \ + TX_THREAD *thread_ptr; \ + thread_ptr = (TX_THREAD *) (a); \ + (thread_ptr -> tx_thread_extension_ptr) = (VOID *)(b); \ + } +#define NX_THREAD_EXTENSION_PTR_GET(a, b, c) { \ + NX_PARAMETER_NOT_USED(c); \ + TX_THREAD *thread_ptr; \ + thread_ptr = tx_thread_identify(); \ + while(1)\ + { \ + if (thread_ptr -> tx_thread_extension_ptr) \ + { \ + (a) = (b *)(thread_ptr -> tx_thread_extension_ptr); \ + break; \ + } \ + tx_thread_sleep(1); \ + } \ + } +#define NX_TIMER_EXTENSION_PTR_SET(a, b) { \ + TX_TIMER *timer_ptr; \ + timer_ptr = (TX_TIMER *) (a); \ + (timer_ptr -> tx_timer_internal.tx_timer_internal_extension_ptr) = (VOID *)(b); \ + } +#define NX_TIMER_EXTENSION_PTR_GET(a, b, c) { \ + NX_PARAMETER_NOT_USED(c); \ + if (!_tx_timer_expired_timer_ptr -> tx_timer_internal_extension_ptr) \ + return; \ + (a) = (b *)(_tx_timer_expired_timer_ptr -> tx_timer_internal_extension_ptr); \ + } + +#endif + diff --git a/test/cmake/netxduo64/regression b/test/cmake/netxduo64/regression new file mode 120000 index 00000000..80d9e12a --- /dev/null +++ b/test/cmake/netxduo64/regression @@ -0,0 +1 @@ +../netxduo/regression \ No newline at end of file diff --git a/test/cmake/netxduo64/run.sh b/test/cmake/netxduo64/run.sh new file mode 100755 index 00000000..675a6298 --- /dev/null +++ b/test/cmake/netxduo64/run.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +cd $(dirname $0) + +# if threadx repo does not exist, clone it +[ -d ../threadx ] || git clone https://github.com/azure-rtos/threadx.git ../threadx --depth 1 +[ -d ../filex ] || git clone https://github.com/azure-rtos/filex.git ../filex --depth 1 +[ -f .run.sh ] || ln -sf ../threadx/scripts/cmake_bootstrap.sh .run.sh +ENABLE_64=ON ./.run.sh $* \ No newline at end of file diff --git a/test/cmake/netxduo64/samples b/test/cmake/netxduo64/samples new file mode 120000 index 00000000..993d1ce9 --- /dev/null +++ b/test/cmake/netxduo64/samples @@ -0,0 +1 @@ +../netxduo/samples \ No newline at end of file diff --git a/test/cmake/netxduo_fast/CMakeLists.txt b/test/cmake/netxduo_fast/CMakeLists.txt new file mode 100644 index 00000000..ce6a934f --- /dev/null +++ b/test/cmake/netxduo_fast/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.13 FATAL_ERROR) +cmake_policy(SET CMP0054 NEW) +cmake_policy(SET CMP0057 NEW) +cmake_policy(SET CMP0077 NEW) + +project(netx_test LANGUAGES C) + +set(NX_USER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/nx_user.h) +include(${CMAKE_CURRENT_SOURCE_DIR}/../netxduo/CMakeLists.txt) + +# Set build configurations +set(BUILD_CONFIGURATIONS v6_full_build) \ No newline at end of file diff --git a/test/cmake/netxduo_fast/additionals.cmake b/test/cmake/netxduo_fast/additionals.cmake new file mode 120000 index 00000000..87f29770 --- /dev/null +++ b/test/cmake/netxduo_fast/additionals.cmake @@ -0,0 +1 @@ +../netxduo/additionals.cmake \ No newline at end of file diff --git a/test/cmake/netxduo_fast/coverage.sh b/test/cmake/netxduo_fast/coverage.sh new file mode 100755 index 00000000..6716090c --- /dev/null +++ b/test/cmake/netxduo_fast/coverage.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -e + +cd $(dirname $0) +mkdir -p coverage_report/$1 +gcovr --object-directory=build/$1/netxduo/CMakeFiles/netxduo.dir/common/src -r ../../../common/src --xml-pretty --output coverage_report/$1.xml +gcovr --object-directory=build/$1/netxduo/CMakeFiles/netxduo.dir/common/src -r ../../../common/src --html --html-details --output coverage_report/$1/index.html diff --git a/test/cmake/netxduo_fast/libs/CMakeLists.txt b/test/cmake/netxduo_fast/libs/CMakeLists.txt new file mode 120000 index 00000000..bf9a13fb --- /dev/null +++ b/test/cmake/netxduo_fast/libs/CMakeLists.txt @@ -0,0 +1 @@ +../../libs/CMakeLists.txt \ No newline at end of file diff --git a/test/cmake/netxduo_fast/libs/tx_user.h b/test/cmake/netxduo_fast/libs/tx_user.h new file mode 100644 index 00000000..ff33c60f --- /dev/null +++ b/test/cmake/netxduo_fast/libs/tx_user.h @@ -0,0 +1,57 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** User Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* tx_user.h PORTABLE C */ +/* 6.0 */ +/* */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains user defines for configuring ThreadX in specific */ +/* ways. This file will have an effect only if the application and */ +/* ThreadX library are built with TX_INCLUDE_USER_DEFINE_FILE defined. */ +/* Note that all the defines in this file may also be made on the */ +/* command line when building ThreadX library and application objects. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 05-19-2020 William E. Lamie Initial Version 6.0 */ +/* */ +/**************************************************************************/ + +#ifndef TX_USER_H +#define TX_USER_H + +#define TX_THREAD_USER_EXTENSION int bsd_errno; +#define TX_TIMER_TICKS_PER_SECOND 1000UL + +#endif \ No newline at end of file diff --git a/test/cmake/netxduo_fast/nx_user.h b/test/cmake/netxduo_fast/nx_user.h new file mode 100644 index 00000000..72cd29c2 --- /dev/null +++ b/test/cmake/netxduo_fast/nx_user.h @@ -0,0 +1,51 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** NetX Component */ +/** */ +/** User Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* nx_user.h PORTABLE C */ +/* 6.0 */ +/* */ +/* AUTHOR */ +/* */ +/* Yuxin Zhou, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains user defines for configuring NetX in specific */ +/* ways. This file will have an effect only if the application and */ +/* NetX library are built with NX_INCLUDE_USER_DEFINE_FILE defined. */ +/* Note that all the defines in this file may also be made on the */ +/* command line when building NetX library and application objects. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 05-19-2020 Yuxin Zhou Initial Version 6.0 */ +/* */ +/**************************************************************************/ + +#define NX_IP_PERIODIC_RATE 1000UL \ No newline at end of file diff --git a/test/cmake/netxduo_fast/regression b/test/cmake/netxduo_fast/regression new file mode 120000 index 00000000..80d9e12a --- /dev/null +++ b/test/cmake/netxduo_fast/regression @@ -0,0 +1 @@ +../netxduo/regression \ No newline at end of file diff --git a/test/cmake/netxduo_fast/run.sh b/test/cmake/netxduo_fast/run.sh new file mode 100755 index 00000000..ff51762d --- /dev/null +++ b/test/cmake/netxduo_fast/run.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +cd $(dirname $0) + +# if threadx repo does not exist, clone it +[ -d ../threadx ] || git clone https://github.com/azure-rtos/threadx.git ../threadx --depth 1 +[ -d ../filex ] || git clone https://github.com/azure-rtos/filex.git ../filex --depth 1 +[ -f .run.sh ] || ln -sf ../threadx/scripts/cmake_bootstrap.sh .run.sh +./.run.sh $* \ No newline at end of file diff --git a/test/cmake/netxduo_fast/samples b/test/cmake/netxduo_fast/samples new file mode 120000 index 00000000..993d1ce9 --- /dev/null +++ b/test/cmake/netxduo_fast/samples @@ -0,0 +1 @@ +../netxduo/samples \ No newline at end of file