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

@ -78,6 +78,7 @@ that synchronise with the xEventGroupSync() function. */
/* A block time of zero simply means "don't block". */
#define ebDONT_BLOCK ( 0 )
#define ebONE_TICK ( ( TickType_t ) 1 )
/* A 5ms delay. */
#define ebSHORT_DELAY pdMS_TO_TICKS( ( TickType_t ) 5 )
@ -281,7 +282,29 @@ EventBits_t uxSynchronisationBit, uxReturned;
/* Set the bit that indicates this task is at the synchronisation
point. The first time this is done the 'test master' task has a lower
priority than this task so this task will get to the sync point before
the set bits task. */
the set bits task - test this by first calling xEventGroupSync() with
a zero block time, and a block time that is too short for the other
task, before calling again with a max delay - the first two calls should
return before the rendezvous completes, the third only after the
rendezvous is complete. */
uxReturned = xEventGroupSync( xEventGroup, /* The event group used for the synchronisation. */
uxSynchronisationBit, /* The bit to set in the event group to indicate this task is at the sync point. */
ebALL_SYNC_BITS,/* The bits to wait for - these bits are set by the other tasks taking part in the sync. */
ebDONT_BLOCK ); /* The maximum time to wait for the sync condition to be met before giving up. */
/* No block time was specified, so as per the comments above, the
rendezvous is not expected to have completed yet. */
configASSERT( ( uxReturned & ebALL_SYNC_BITS ) != ebALL_SYNC_BITS );
uxReturned = xEventGroupSync( xEventGroup, /* The event group used for the synchronisation. */
uxSynchronisationBit, /* The bit to set in the event group to indicate this task is at the sync point. */
ebALL_SYNC_BITS, /* The bits to wait for - these bits are set by the other tasks taking part in the sync. */
ebONE_TICK ); /* The maximum time to wait for the sync condition to be met before giving up. */
/* A short block time was specified, so as per the comments above, the
rendezvous is not expected to have completed yet. */
configASSERT( ( uxReturned & ebALL_SYNC_BITS ) != ebALL_SYNC_BITS );
uxReturned = xEventGroupSync( xEventGroup, /* The event group used for the synchronisation. */
uxSynchronisationBit, /* The bit to set in the event group to indicate this task is at the sync point. */
ebALL_SYNC_BITS,/* The bits to wait for - these bits are set by the other tasks taking part in the sync. */