mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-09-12 17:17:44 -04:00
Merge branch 'main' into main
This commit is contained in:
commit
397ca2e7d0
5 changed files with 71 additions and 12 deletions
56
.github/workflows/unit-tests.yml
vendored
Normal file
56
.github/workflows/unit-tests.yml
vendored
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
name: CMock Unit Tests
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
run:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout Parent Repo
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
ref: master
|
||||||
|
repository: FreeRTOS/FreeRTOS
|
||||||
|
submodules: 'recursive'
|
||||||
|
fetch-depth: 1
|
||||||
|
- name: Clone This Repo
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
path: ./FreeRTOS/Source
|
||||||
|
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@master
|
||||||
|
with:
|
||||||
|
python-version: 3.8
|
||||||
|
|
||||||
|
- name: Install packages
|
||||||
|
run: |
|
||||||
|
sudo apt-get install lcov cflow ruby doxygen build-essential
|
||||||
|
- name: Run Unit Tests with ENABLE_SANITIZER=1
|
||||||
|
run: |
|
||||||
|
make -C FreeRTOS/Test/CMock clean
|
||||||
|
make -C FreeRTOS/Test/CMock ENABLE_SANITIZER=1 run_col_formatted
|
||||||
|
- name: Run Unit Tests for coverage
|
||||||
|
run: |
|
||||||
|
make -C FreeRTOS/Test/CMock clean
|
||||||
|
make -C FreeRTOS/Test/CMock lcovhtml
|
||||||
|
lcov --config-file FreeRTOS/Test/CMock/lcovrc --summary FreeRTOS/Test/CMock/build/cmock_test.info > FreeRTOS/Test/CMock/build/cmock_test_summary.txt
|
||||||
|
- name: Upload coverage to Codecov
|
||||||
|
uses: codecov/codecov-action@v1
|
||||||
|
with:
|
||||||
|
files: FreeRTOS/Test/CMock/build/cmock_test.info
|
||||||
|
working-directory: .
|
||||||
|
root_dir: FreeRTOS/Source
|
||||||
|
flags: unittests
|
||||||
|
fail_ci_if_error: false
|
||||||
|
path_to_write_report: coverage/codecov_report.txt
|
||||||
|
verbose: false
|
||||||
|
- name: Archive code coverage data
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: coverage-data
|
||||||
|
path: FreeRTOS/Test/CMock/build/cmock_test*
|
||||||
|
- name: Archive code coverage html report
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: coverage-report
|
||||||
|
path: FreeRTOS/Test/CMock/build/coverage
|
3
list.c
3
list.c
|
@ -158,6 +158,9 @@ void vListInsert( List_t * const pxList,
|
||||||
* 4) Using a queue or semaphore before it has been initialised or
|
* 4) Using a queue or semaphore before it has been initialised or
|
||||||
* before the scheduler has been started (are interrupts firing
|
* before the scheduler has been started (are interrupts firing
|
||||||
* before vTaskStartScheduler() has been called?).
|
* before vTaskStartScheduler() has been called?).
|
||||||
|
* 5) If the FreeRTOS port supports interrupt nesting then ensure that
|
||||||
|
* the priority of the tick interrupt is at or below
|
||||||
|
* configMAX_SYSCALL_INTERRUPT_PRIORITY.
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
|
|
||||||
for( pxIterator = ( ListItem_t * ) &( pxList->xListEnd ); pxIterator->pxNext->xItemValue <= xValueOfInsertion; pxIterator = pxIterator->pxNext ) /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM. This is checked and valid. *//*lint !e440 The iterator moves to a different value, not xValueOfInsertion. */
|
for( pxIterator = ( ListItem_t * ) &( pxList->xListEnd ); pxIterator->pxNext->xItemValue <= xValueOfInsertion; pxIterator = pxIterator->pxNext ) /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM. This is checked and valid. *//*lint !e440 The iterator moves to a different value, not xValueOfInsertion. */
|
||||||
|
|
|
@ -762,10 +762,10 @@ __asm uint32_t vPortGetIPSR( void )
|
||||||
* be set to a value equal to or numerically *higher* than
|
* be set to a value equal to or numerically *higher* than
|
||||||
* configMAX_SYSCALL_INTERRUPT_PRIORITY.
|
* configMAX_SYSCALL_INTERRUPT_PRIORITY.
|
||||||
*
|
*
|
||||||
* Interrupts that use the FreeRTOS API must not be left at their
|
* Interrupts that use the FreeRTOS API must not be left at their
|
||||||
* default priority of zero as that is the highest possible priority,
|
* default priority of zero as that is the highest possible priority,
|
||||||
* which is guaranteed to be above configMAX_SYSCALL_INTERRUPT_PRIORITY,
|
* which is guaranteed to be above configMAX_SYSCALL_INTERRUPT_PRIORITY,
|
||||||
* and therefore also guaranteed to be invalid.
|
* and therefore also guaranteed to be invalid.
|
||||||
*
|
*
|
||||||
* FreeRTOS maintains separate thread and ISR API functions to ensure
|
* FreeRTOS maintains separate thread and ISR API functions to ensure
|
||||||
* interrupt entry is as fast and simple as possible.
|
* interrupt entry is as fast and simple as possible.
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE /*lint !e961 !e750 !e9021. */
|
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE /*lint !e961 !e750 !e9021. */
|
||||||
|
|
||||||
/* If the user has not provided application specific Rx notification macros,
|
/* If the user has not provided application specific Rx notification macros,
|
||||||
* or #defined the notification macros away, them provide default implementations
|
* or #defined the notification macros away, then provide default implementations
|
||||||
* that uses task notifications. */
|
* that uses task notifications. */
|
||||||
/*lint -save -e9026 Function like macros allowed and needed here so they can be overridden. */
|
/*lint -save -e9026 Function like macros allowed and needed here so they can be overridden. */
|
||||||
#ifndef sbRECEIVE_COMPLETED
|
#ifndef sbRECEIVE_COMPLETED
|
||||||
|
@ -267,7 +267,6 @@ static void prvInitialiseNewStreamBuffer( StreamBuffer_t * const pxStreamBuffer,
|
||||||
{
|
{
|
||||||
pucAllocatedMemory = NULL;
|
pucAllocatedMemory = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if( pucAllocatedMemory != NULL )
|
if( pucAllocatedMemory != NULL )
|
||||||
{
|
{
|
||||||
|
@ -466,7 +465,7 @@ BaseType_t xStreamBufferSetTriggerLevel( StreamBufferHandle_t xStreamBuffer,
|
||||||
|
|
||||||
/* The trigger level is the number of bytes that must be in the stream
|
/* The trigger level is the number of bytes that must be in the stream
|
||||||
* buffer before a task that is waiting for data is unblocked. */
|
* buffer before a task that is waiting for data is unblocked. */
|
||||||
if( xTriggerLevel <= pxStreamBuffer->xLength )
|
if( xTriggerLevel < pxStreamBuffer->xLength )
|
||||||
{
|
{
|
||||||
pxStreamBuffer->xTriggerLevelBytes = xTriggerLevel;
|
pxStreamBuffer->xTriggerLevelBytes = xTriggerLevel;
|
||||||
xReturn = pdPASS;
|
xReturn = pdPASS;
|
||||||
|
@ -525,14 +524,15 @@ size_t xStreamBufferSend( StreamBufferHandle_t xStreamBuffer,
|
||||||
size_t xReturn, xSpace = 0;
|
size_t xReturn, xSpace = 0;
|
||||||
size_t xRequiredSpace = xDataLengthBytes;
|
size_t xRequiredSpace = xDataLengthBytes;
|
||||||
TimeOut_t xTimeOut;
|
TimeOut_t xTimeOut;
|
||||||
|
size_t xMaxReportedSpace = 0;
|
||||||
/* The maximum amount of space a stream buffer will ever report is its length
|
|
||||||
* minus 1. */
|
|
||||||
const size_t xMaxReportedSpace = pxStreamBuffer->xLength - ( size_t ) 1;
|
|
||||||
|
|
||||||
configASSERT( pvTxData );
|
configASSERT( pvTxData );
|
||||||
configASSERT( pxStreamBuffer );
|
configASSERT( pxStreamBuffer );
|
||||||
|
|
||||||
|
/* The maximum amount of space a stream buffer will ever report is its length
|
||||||
|
* minus 1. */
|
||||||
|
xMaxReportedSpace = pxStreamBuffer->xLength - ( size_t ) 1;
|
||||||
|
|
||||||
/* This send function is used to write to both message buffers and stream
|
/* This send function is used to write to both message buffers and stream
|
||||||
* buffers. If this is a message buffer then the space needed must be
|
* buffers. If this is a message buffer then the space needed must be
|
||||||
* increased by the amount of bytes needed to store the length of the
|
* increased by the amount of bytes needed to store the length of the
|
||||||
|
|
4
tasks.c
4
tasks.c
|
@ -2238,8 +2238,8 @@ BaseType_t xTaskResumeAll( void )
|
||||||
( void ) uxListRemove( &( pxTCB->xStateListItem ) );
|
( void ) uxListRemove( &( pxTCB->xStateListItem ) );
|
||||||
prvAddTaskToReadyList( pxTCB );
|
prvAddTaskToReadyList( pxTCB );
|
||||||
|
|
||||||
/* If the moved task has a priority higher than the current
|
/* If the moved task has a priority higher than or equal to
|
||||||
* task then a yield must be performed. */
|
* the current task then a yield must be performed. */
|
||||||
if( pxTCB->uxPriority >= pxCurrentTCB->uxPriority )
|
if( pxTCB->uxPriority >= pxCurrentTCB->uxPriority )
|
||||||
{
|
{
|
||||||
xYieldPending = pdTRUE;
|
xYieldPending = pdTRUE;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue