Import the code coverage test additions from the (unpublished) Visual Studio project to the (published) MingW/Eclipse project.

Update the MingW/Eclipse project to add a code coverage build configuration in addition to the existing Debug build configuration.
Update StreamBufferDemo.c so functions are called directly, rather than via configASSERT(), so their code coverage can be measured when configASSERT() is not defined.
In the Win32 port, replace the call to TerminateProcess() in vPortEndScheduler() with exit( 0 ) - which triggers the writing of the code coverage data to the disk.
Fix bug in ucStreamBufferGetStreamBufferType() - which is only used by the Percepio trace tool.
Update the line within vTaskStartScheduler() that was setting xTickCount to 0 to instead set it to configINITIAL_TICK_COUNT.
This commit is contained in:
Richard Barry 2018-03-14 15:58:47 +00:00
parent bf8d9f4726
commit aec45f2479
14 changed files with 818 additions and 125 deletions

View file

@ -433,11 +433,20 @@ QueueHandle_t xQueue;
/* The tests in this function are very similar, the slight variations
are for code coverage purposes. */
/* Take the mutex. It should be available now. */
/* Take the mutex. It should be available now. Check before and after
taking that the holder is reported correctly. */
if( xSemaphoreGetMutexHolder( xMutex ) != NULL )
{
xErrorDetected = pdTRUE;
}
if( xSemaphoreTake( xMutex, intsemNO_BLOCK ) != pdPASS )
{
xErrorDetected = pdTRUE;
}
if( xSemaphoreGetMutexHolder( xMutex ) != xTaskGetCurrentTaskHandle() )
{
xErrorDetected = pdTRUE;
}
/* This task's priority should be as per that assigned when the task was
created. */
@ -524,8 +533,17 @@ QueueHandle_t xQueue;
vTaskDelay( genqSHORT_BLOCK );
}
/* Give the semaphore back ready for the next test. */
/* Give the semaphore back ready for the next test. Check the mutex
holder before and after using the "FromISR" version for code coverage. */
if( xSemaphoreGetMutexHolderFromISR( xMutex ) != xTaskGetCurrentTaskHandle() )
{
xErrorDetected = pdTRUE;
}
xSemaphoreGive( xMutex );
if( xSemaphoreGetMutexHolderFromISR( xMutex ) != NULL )
{
xErrorDetected = pdTRUE;
}
configASSERT( xErrorDetected == pdFALSE );