Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add netxduo64 and fast test. #216

Merged
merged 3 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 33 additions & 2 deletions .github/workflows/regression_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
deploy_list: "NetXDuo Web MQTT NetXDuo64 NetXDuo_fast"
3 changes: 3 additions & 0 deletions scripts/build_nxd64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#! /bin/bash

$(dirname `realpath $0`)/../test/cmake/netxduo64/run.sh build all
3 changes: 3 additions & 0 deletions scripts/build_nxd_fast.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#! /bin/bash

$(dirname `realpath $0`)/../test/cmake/netxduo_fast/run.sh build all
3 changes: 3 additions & 0 deletions scripts/test_nxd64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#! /bin/bash

CTEST_PARALLEL_LEVEL=4 $(dirname `realpath $0`)/../test/cmake/netxduo64/run.sh test all
3 changes: 3 additions & 0 deletions scripts/test_nxd_fast.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#! /bin/bash

CTEST_PARALLEL_LEVEL=4 $(dirname `realpath $0`)/../test/cmake/netxduo_fast/run.sh test all
47 changes: 47 additions & 0 deletions test/cmake/netxduo64/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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}")
8 changes: 8 additions & 0 deletions test/cmake/netxduo64/coverage.sh
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions test/cmake/netxduo64/libs
87 changes: 87 additions & 0 deletions test/cmake/netxduo64/nx_user.h
Original file line number Diff line number Diff line change
@@ -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

1 change: 1 addition & 0 deletions test/cmake/netxduo64/regression
9 changes: 9 additions & 0 deletions test/cmake/netxduo64/run.sh
Original file line number Diff line number Diff line change
@@ -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 $*
1 change: 1 addition & 0 deletions test/cmake/netxduo64/samples
12 changes: 12 additions & 0 deletions test/cmake/netxduo_fast/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
1 change: 1 addition & 0 deletions test/cmake/netxduo_fast/additionals.cmake
8 changes: 8 additions & 0 deletions test/cmake/netxduo_fast/coverage.sh
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions test/cmake/netxduo_fast/libs/CMakeLists.txt
57 changes: 57 additions & 0 deletions test/cmake/netxduo_fast/libs/tx_user.h
Original file line number Diff line number Diff line change
@@ -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
51 changes: 51 additions & 0 deletions test/cmake/netxduo_fast/nx_user.h
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions test/cmake/netxduo_fast/regression
9 changes: 9 additions & 0 deletions test/cmake/netxduo_fast/run.sh
Original file line number Diff line number Diff line change
@@ -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 $*
1 change: 1 addition & 0 deletions test/cmake/netxduo_fast/samples