]> git.sur5r.net Git - freertos/commitdiff
Start moving code coverage tests from VisualStudio (not checked in) to the MingW...
authorrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Tue, 6 Mar 2018 17:23:55 +0000 (17:23 +0000)
committerrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Tue, 6 Mar 2018 17:23:55 +0000 (17:23 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2533 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

FreeRTOS/Demo/Common/Minimal/MessageBufferAMP.c
FreeRTOS/Demo/WIN32-MingW/.cproject
FreeRTOS/Demo/WIN32-MingW/.settings/org.eclipse.cdt.managedbuilder.core.prefs
FreeRTOS/Demo/WIN32-MingW/FreeRTOSConfig.h
FreeRTOS/Demo/WIN32-MingW/main_full.c
FreeRTOS/Source/list.c

index 0d50295b2b0c3713c0a86bf65054ebd4f8a9d185..dd7a209c79da225dd50349fcd7f2167543bb44c5 100644 (file)
@@ -230,6 +230,7 @@ char cReceivedString[ 15 ];
 \r
                /* Check the number of bytes received was as expected. */\r
                configASSERT( xReceivedBytes == strlen( cExpectedString ) );\r
+               ( void ) xReceivedBytes; /* Incase configASSERT() is not defined. */\r
 \r
                /* If the received string matches that expected then increment the loop\r
                counter so the check task knows this task is still running. */\r
index c4882f3f4ebc3e06b6fa4d4d40b78c04c6a30e3f..c2bd401d5f90adaa9b497a6579caccdc02a010ea 100644 (file)
@@ -2,7 +2,7 @@
 <?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">\r
        <storageModule moduleId="org.eclipse.cdt.core.settings">\r
                <cconfiguration id="cdt.managedbuild.config.gnu.mingw.exe.debug.396692239">\r
-                       <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.exe.debug.396692239" moduleId="org.eclipse.cdt.core.settings" name="Debug_Full">\r
+                       <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.exe.debug.396692239" moduleId="org.eclipse.cdt.core.settings" name="Debug">\r
                                <externalSettings/>\r
                                <extensions>\r
                                        <extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>\r
@@ -12,7 +12,7 @@
                                </extensions>\r
                        </storageModule>\r
                        <storageModule moduleId="cdtBuildSystem" version="4.0.0">\r
-                               <configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="Everything Enabled" id="cdt.managedbuild.config.gnu.mingw.exe.debug.396692239" name="Debug_Full" parent="cdt.managedbuild.config.gnu.mingw.exe.debug">\r
+                               <configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="Everything Enabled" id="cdt.managedbuild.config.gnu.mingw.exe.debug.396692239" name="Debug" parent="cdt.managedbuild.config.gnu.mingw.exe.debug">\r
                                        <folderInfo id="cdt.managedbuild.config.gnu.mingw.exe.debug.396692239." name="/" resourcePath="">\r
                                                <toolChain id="cdt.managedbuild.toolchain.gnu.mingw.exe.debug.1619684599" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.exe.debug">\r
                                                        <targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.exe.debug.1827277435" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.exe.debug"/>\r
                        </storageModule>\r
                        <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>\r
                </cconfiguration>\r
+               <cconfiguration id="cdt.managedbuild.config.gnu.mingw.exe.debug.396692239.539393069">\r
+                       <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.exe.debug.396692239.539393069" moduleId="org.eclipse.cdt.core.settings" name="Debug_CodeCoverage">\r
+                               <externalSettings/>\r
+                               <extensions>\r
+                                       <extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>\r
+                                       <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                                       <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                                       <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                               </extensions>\r
+                       </storageModule>\r
+                       <storageModule moduleId="cdtBuildSystem" version="4.0.0">\r
+                               <configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="Used to measure test coverage." id="cdt.managedbuild.config.gnu.mingw.exe.debug.396692239.539393069" name="Debug_CodeCoverage" parent="cdt.managedbuild.config.gnu.mingw.exe.debug">\r
+                                       <folderInfo id="cdt.managedbuild.config.gnu.mingw.exe.debug.396692239.539393069." name="/" resourcePath="">\r
+                                               <toolChain id="cdt.managedbuild.toolchain.gnu.mingw.exe.debug.1356530966" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.exe.debug">\r
+                                                       <targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.exe.debug.1435999765" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.exe.debug"/>\r
+                                                       <builder buildPath="${workspace_loc:/RTOSDemo}/Debug" id="org.eclipse.cdt.build.core.internal.builder.1678758599" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="org.eclipse.cdt.build.core.internal.builder"/>\r
+                                                       <tool id="cdt.managedbuild.tool.gnu.assembler.mingw.exe.debug.1491907534" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.exe.debug">\r
+                                                               <inputType id="cdt.managedbuild.tool.gnu.assembler.input.727588633" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>\r
+                                                       </tool>\r
+                                                       <tool id="cdt.managedbuild.tool.gnu.archiver.mingw.base.879976787" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.base"/>\r
+                                                       <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug.696574374" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug">\r
+                                                               <option id="gnu.cpp.compiler.mingw.exe.debug.option.optimization.level.224175256" name="Optimization Level" superClass="gnu.cpp.compiler.mingw.exe.debug.option.optimization.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>\r
+                                                               <option id="gnu.cpp.compiler.mingw.exe.debug.option.debugging.level.448631194" name="Debug Level" superClass="gnu.cpp.compiler.mingw.exe.debug.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>\r
+                                                       </tool>\r
+                                                       <tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.459015716" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug">\r
+                                                               <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.mingw.exe.debug.option.optimization.level.1968002859" name="Optimization Level" superClass="gnu.c.compiler.mingw.exe.debug.option.optimization.level" useByScannerDiscovery="false" value="gnu.c.optimization.level.none" valueType="enumerated"/>\r
+                                                               <option id="gnu.c.compiler.mingw.exe.debug.option.debugging.level.434354805" name="Debug Level" superClass="gnu.c.compiler.mingw.exe.debug.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated"/>\r
+                                                               <option id="gnu.c.compiler.option.include.paths.1988602727" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/FreeRTOS_Source/include}&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/FreeRTOS+Trace Recorder/Include}&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Trace_Recorder_Configuration}&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Standard_Demo_Tasks/Include}&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/FreeRTOS_Source/portable/MSVC-MingW}&quot;"/>\r
+                                                               </option>\r
+                                                               <option id="gnu.c.compiler.option.debugging.prof.851725944" name="Generate prof information (-p)" superClass="gnu.c.compiler.option.debugging.prof" useByScannerDiscovery="false" value="false" valueType="boolean"/>\r
+                                                               <option id="gnu.c.compiler.option.warnings.extrawarn.1476381388" name="Extra warnings (-Wextra)" superClass="gnu.c.compiler.option.warnings.extrawarn" useByScannerDiscovery="false" value="true" valueType="boolean"/>\r
+                                                               <option id="gnu.c.compiler.option.misc.other.579987442" name="Other flags" superClass="gnu.c.compiler.option.misc.other" useByScannerDiscovery="false" value="-c -fmessage-length=0 -Wcast-qual" valueType="string"/>\r
+                                                               <option id="gnu.c.compiler.option.debugging.gprof.1677007018" name="Generate gprof information (-pg)" superClass="gnu.c.compiler.option.debugging.gprof" useByScannerDiscovery="false" value="false" valueType="boolean"/>\r
+                                                               <option id="gnu.c.compiler.option.preprocessor.def.symbols.175065197" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols">\r
+                                                                       <listOptionValue builtIn="false" value="_WIN32_WINNT=0x0601"/>\r
+                                                               </option>\r
+                                                               <option id="gnu.c.compiler.option.debugging.codecov.1668225592" name="Generate gcov information (-ftest-coverage -fprofile-arcs)" superClass="gnu.c.compiler.option.debugging.codecov" useByScannerDiscovery="false" value="true" valueType="boolean"/>\r
+                                                               <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.132282928" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>\r
+                                                       </tool>\r
+                                                       <tool command="gcc" id="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug.1446677213" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug">\r
+                                                               <option id="gnu.c.link.option.ldflags.2104552465" name="Linker flags" superClass="gnu.c.link.option.ldflags" value="" valueType="string"/>\r
+                                                               <option id="gnu.c.link.option.libs.1317379654" name="Libraries (-l)" superClass="gnu.c.link.option.libs" valueType="libs">\r
+                                                                       <listOptionValue builtIn="false" value="winmm"/>\r
+                                                               </option>\r
+                                                               <option id="gnu.c.link.option.noshared.1981833702" name="No shared libraries (-static)" superClass="gnu.c.link.option.noshared" value="false" valueType="boolean"/>\r
+                                                               <option id="gnu.c.link.option.debugging.prof.1376550930" name="Generate prof information (-p)" superClass="gnu.c.link.option.debugging.prof" value="false" valueType="boolean"/>\r
+                                                               <option id="gnu.c.link.option.debugging.gprof.226083676" name="Generate gprof information (-pg)" superClass="gnu.c.link.option.debugging.gprof" value="false" valueType="boolean"/>\r
+                                                               <option id="gnu.c.link.option.other.1438832148" name="Other options (-Xlinker [option])" superClass="gnu.c.link.option.other" useByScannerDiscovery="false" valueType="stringList">\r
+                                                                       <listOptionValue builtIn="false" value="-Map=rtosdemo.map"/>\r
+                                                               </option>\r
+                                                               <option id="gnu.c.link.option.debugging.codecov.1722305479" name="Generate gcov information (-ftest-coverage -fprofile-arcs)" superClass="gnu.c.link.option.debugging.codecov" value="true" valueType="boolean"/>\r
+                                                               <inputType id="cdt.managedbuild.tool.gnu.c.linker.input.348983874" superClass="cdt.managedbuild.tool.gnu.c.linker.input">\r
+                                                                       <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>\r
+                                                                       <additionalInput kind="additionalinput" paths="$(LIBS)"/>\r
+                                                               </inputType>\r
+                                                       </tool>\r
+                                                       <tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.debug.136576791" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.debug"/>\r
+                                               </toolChain>\r
+                                       </folderInfo>\r
+                                       <sourceEntries>\r
+                                               <entry excluding="FreeRTOS+Trace Recorder/streamports" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>\r
+                                       </sourceEntries>\r
+                               </configuration>\r
+                       </storageModule>\r
+                       <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>\r
+               </cconfiguration>\r
        </storageModule>\r
        <storageModule moduleId="cdtBuildSystem" version="4.0.0">\r
                <project id="RTOSDemo.cdt.managedbuild.target.gnu.mingw.exe.393672054" name="Executable" projectType="cdt.managedbuild.target.gnu.mingw.exe"/>\r
index 253db6839ecc0a19c90e2be8a61ba6635272caff..3bed239d5f7cafaebe08d17ec1fad28ed59a9b46 100644 (file)
@@ -5,6 +5,12 @@ environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.
 environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.396692239.1332190083/C_INCLUDE_PATH/operation=remove\r
 environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.396692239.1332190083/append=true\r
 environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.396692239.1332190083/appendContributed=true\r
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.396692239.539393069/CPATH/delimiter=;\r
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.396692239.539393069/CPATH/operation=remove\r
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.396692239.539393069/C_INCLUDE_PATH/delimiter=;\r
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.396692239.539393069/C_INCLUDE_PATH/operation=remove\r
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.396692239.539393069/append=true\r
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.396692239.539393069/appendContributed=true\r
 environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.396692239/CPATH/delimiter=;\r
 environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.396692239/CPATH/operation=remove\r
 environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.396692239/C_INCLUDE_PATH/delimiter=;\r
@@ -15,6 +21,10 @@ environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.
 environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.396692239.1332190083/LIBRARY_PATH/operation=remove\r
 environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.396692239.1332190083/append=true\r
 environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.396692239.1332190083/appendContributed=true\r
+environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.396692239.539393069/LIBRARY_PATH/delimiter=;\r
+environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.396692239.539393069/LIBRARY_PATH/operation=remove\r
+environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.396692239.539393069/append=true\r
+environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.396692239.539393069/appendContributed=true\r
 environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.396692239/LIBRARY_PATH/delimiter=;\r
 environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.396692239/LIBRARY_PATH/operation=remove\r
 environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.396692239/append=true\r
index 671508c9a8db4acd69ceee6900eb1ec9a4f375a5..b73d975247457cc6cfbbfc01100e35f9d9b8e983 100644 (file)
@@ -109,17 +109,27 @@ functions anyway. */
 #define INCLUDE_xTimerPendFunctionCall                 1\r
 #define INCLUDE_xTaskAbortDelay                                        1\r
 \r
-/* It is a good idea to define configASSERT() while developing.  configASSERT()\r
-uses the same semantics as the standard C assert() macro. */\r
-extern void vAssertCalled( unsigned long ulLine, const char * const pcFileName );\r
-#define configASSERT( x ) if( ( x ) == 0 ) vAssertCalled( __LINE__, __FILE__ )\r
-\r
 #define configINCLUDE_MESSAGE_BUFFER_AMP_DEMO  0\r
 #if ( configINCLUDE_MESSAGE_BUFFER_AMP_DEMO == 1 )\r
        extern void vGenerateCoreBInterrupt( void * xUpdatedMessageBuffer );\r
        #define sbSEND_COMPLETED( pxStreamBuffer ) vGenerateCoreBInterrupt( pxStreamBuffer )\r
 #endif /* configINCLUDE_MESSAGE_BUFFER_AMP_DEMO */\r
 \r
+extern void vAssertCalled( unsigned long ulLine, const char * const pcFileName );\r
+#define configCOVERAGE_TEST 1\r
+#if( configCOVERAGE_TEST == 1 )\r
+       /* Insert NOPs in empty decision paths to ensure both true and false paths\r
+       are being tested. */\r
+       #define mtCOVERAGE_TEST_MARKER() __asm volatile( "NOP" )\r
+#else\r
+       /* It is a good idea to define configASSERT() while developing.  configASSERT()\r
+       uses the same semantics as the standard C assert() macro.  Don't define\r
+       configASSERT() when performing code coverage tests though, as it is not\r
+       intended to asserts() to fail, some some code is intended not to run if no\r
+       errors are present. */\r
+       #define configASSERT( x ) if( ( x ) == 0 ) vAssertCalled( __LINE__, __FILE__ )\r
+#endif\r
+\r
 /* Include the FreeRTOS+Trace FreeRTOS trace macro definitions. */\r
 #include "trcRecorder.h"\r
 \r
index 38e303521e3c5ee5b371a87344d2d1ee73341434..96f02c4522a4ce0467f4965dac810b32524e7ee0 100644 (file)
@@ -445,6 +445,19 @@ void *pvAllocated;
        allocations so there is no need to test here. */\r
        pvAllocated = pvPortMalloc( ( rand() % 500 ) + 1 );\r
        vPortFree( pvAllocated );\r
+\r
+       /* Exit after a fixed time so code coverage results are written to the\r
+       disk. */\r
+       #if( configCOVERAGE_TEST == 1 )\r
+       {\r
+               const TickType_t xMaxRunTime = pdMS_TO_TICKS( 60000UL );\r
+\r
+               if( xTaskGetTickCount() >= xMaxRunTime )\r
+               {\r
+                       exit( 0 );\r
+               }\r
+       }\r
+       #endif\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
index e3a54e3609c561410048e9856ec33da762ca385e..88191c5f8cec06f932d5a3d6378e9960f2a35ee5 100644 (file)
@@ -114,7 +114,7 @@ const TickType_t xValueOfInsertion = pxNewListItem->xItemValue;
        /* Insert the new list item into the list, sorted in xItemValue order.\r
 \r
        If the list already contains a list item with the same item value then the\r
-       new list item should be placed after it.  This ensures that TCB's which are\r
+       new list item should be placed after it.  This ensures that TCBs which are\r
        stored in ready lists (all of which have the same xItemValue value) get a\r
        share of the CPU.  However, if the xItemValue is the same as the back marker\r
        the iteration loop below will not end.  Therefore the value is checked\r