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

@ -47,7 +47,7 @@
#define configUSE_DAEMON_TASK_STARTUP_HOOK 1
#define configTICK_RATE_HZ ( 1000 ) /* In this non-real time simulated environment the tick frequency has to be at least a multiple of the Win32 tick frequency, and therefore very slow. */
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 70 ) /* In this simulated case, the stack only has to hold one small structure as the real stack is part of the win32 thread. */
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 45 * 1024 ) )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 65 * 1024 ) )
#define configMAX_TASK_NAME_LEN ( 12 )
#define configUSE_TRACE_FACILITY 1
#define configUSE_16_BIT_TICKS 0
@ -56,7 +56,6 @@
#define configCHECK_FOR_STACK_OVERFLOW 0
#define configUSE_RECURSIVE_MUTEXES 1
#define configQUEUE_REGISTRY_SIZE 20
#define configUSE_MALLOC_FAILED_HOOK 1
#define configUSE_APPLICATION_TASK_TAG 1
#define configUSE_COUNTING_SEMAPHORES 1
#define configUSE_ALTERNATIVE_API 0
@ -64,7 +63,10 @@
#define configUSE_TASK_NOTIFICATIONS 1
#define configSUPPORT_STATIC_ALLOCATION 1
/* Software timer related configuration options. */
/* Software timer related configuration options. The maximum possible task
priority is configMAX_PRIORITIES - 1. The priority of the timer task is
deliberately set higher to ensure it is correctly capped back to
configMAX_PRIORITIES - 1. */
#define configUSE_TIMERS 1
#define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 )
#define configTIMER_QUEUE_LENGTH 20
@ -80,14 +82,18 @@ void vConfigureTimerForRunTimeStats( void ); /* Prototype of function that initi
#define portGET_RUN_TIME_COUNTER_VALUE() ulGetRunTimeCounterValue()
/* Co-routine related configuration options. */
#define configUSE_CO_ROUTINES 1
#define configUSE_CO_ROUTINES 0
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
/* This demo makes use of one or more example stats formatting functions. These
/* This demo can use of one or more example stats formatting functions. These
format the raw data provided by the uxTaskGetSystemState() function in to human
readable ASCII form. See the notes in the implementation of vTaskList() within
FreeRTOS/Source/tasks.c for limitations. */
#define configUSE_STATS_FORMATTING_FUNCTIONS 1
#define configUSE_STATS_FORMATTING_FUNCTIONS 0
/* Enables the test whereby a stack larger than the total heap size is
requested. */
#define configSTACK_DEPTH_TYPE uint32_t
/* Set the following definitions to 1 to include the API function, or zero
to exclude the API function. In most cases the linker will remove unused
@ -116,11 +122,24 @@ functions anyway. */
#endif /* configINCLUDE_MESSAGE_BUFFER_AMP_DEMO */
extern void vAssertCalled( unsigned long ulLine, const char * const pcFileName );
#define configCOVERAGE_TEST 1
#if( configCOVERAGE_TEST == 1 )
/* projCOVERAGE_TEST should be defined on the command line so this file can be
used with multiple project configurations. If it is
*/
#ifndef projCOVERAGE_TEST
#error projCOVERAGE_TEST should be defined to 1 or 0 on the command line.
#endif
#if( projCOVERAGE_TEST == 1 )
/* Insert NOPs in empty decision paths to ensure both true and false paths
are being tested. */
#define mtCOVERAGE_TEST_MARKER() __asm volatile( "NOP" )
/* Ensure the tick count overflows during the coverage test. */
#define configINITIAL_TICK_COUNT 0xffffd800UL
/* Allows tests of trying to allocate more than the heap has free. */
#define configUSE_MALLOC_FAILED_HOOK 0
#else
/* It is a good idea to define configASSERT() while developing. configASSERT()
uses the same semantics as the standard C assert() macro. Don't define
@ -128,9 +147,12 @@ extern void vAssertCalled( unsigned long ulLine, const char * const pcFileName )
intended to asserts() to fail, some some code is intended not to run if no
errors are present. */
#define configASSERT( x ) if( ( x ) == 0 ) vAssertCalled( __LINE__, __FILE__ )
#define configUSE_MALLOC_FAILED_HOOK 1
/* Include the FreeRTOS+Trace FreeRTOS trace macro definitions. */
#include "trcRecorder.h"
#endif
/* Include the FreeRTOS+Trace FreeRTOS trace macro definitions. */
#include "trcRecorder.h"
#endif /* FREERTOS_CONFIG_H */