mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-09-01 11:53:53 -04:00
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:
parent
bf8d9f4726
commit
aec45f2479
14 changed files with 818 additions and 125 deletions
|
@ -120,6 +120,12 @@
|
|||
|
||||
#define mainTIMER_TEST_PERIOD ( 50 )
|
||||
|
||||
/*
|
||||
* Exercises code that is not otherwise covered by the standard demo/test
|
||||
* tasks.
|
||||
*/
|
||||
extern BaseType_t xRunCodeCoverageTestAdditions( void );
|
||||
|
||||
/* Task function prototypes. */
|
||||
static void prvCheckTask( void *pvParameters );
|
||||
|
||||
|
@ -420,7 +426,6 @@ void *pvAllocated;
|
|||
timer. */
|
||||
prvDemonstrateTimerQueryFunctions();
|
||||
|
||||
|
||||
/* If xMutexToDelete has not already been deleted, then delete it now.
|
||||
This is done purely to demonstrate the use of, and test, the
|
||||
vSemaphoreDelete() macro. Care must be taken not to delete a semaphore
|
||||
|
@ -448,13 +453,19 @@ void *pvAllocated;
|
|||
|
||||
/* Exit after a fixed time so code coverage results are written to the
|
||||
disk. */
|
||||
#if( configCOVERAGE_TEST == 1 )
|
||||
#if( projCOVERAGE_TEST == 1 )
|
||||
{
|
||||
const TickType_t xMaxRunTime = pdMS_TO_TICKS( 60000UL );
|
||||
const TickType_t xMaxRunTime = pdMS_TO_TICKS( 30000UL );
|
||||
|
||||
if( xTaskGetTickCount() >= xMaxRunTime )
|
||||
/* Exercise code not otherwise executed by standard demo/test tasks. */
|
||||
if( xRunCodeCoverageTestAdditions() != pdPASS )
|
||||
{
|
||||
exit( 0 );
|
||||
pcStatusMessage = "Code coverage additions failed.\r\n";
|
||||
}
|
||||
|
||||
if( ( xTaskGetTickCount() - configINITIAL_TICK_COUNT ) >= xMaxRunTime )
|
||||
{
|
||||
vTaskEndScheduler();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue