]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/WIN32-MingW/main_full.c
Import the code coverage test additions from the (unpublished) Visual Studio project...
[freertos] / FreeRTOS / Demo / WIN32-MingW / main_full.c
index 96f02c4522a4ce0467f4965dac810b32524e7ee0..b8e06d184646cf1d7a8840e9b402f93356e9570d 100644 (file)
 \r
 #define mainTIMER_TEST_PERIOD                  ( 50 )\r
 \r
+/*\r
+ * Exercises code that is not otherwise covered by the standard demo/test\r
+ * tasks.\r
+ */\r
+extern BaseType_t xRunCodeCoverageTestAdditions( void );\r
+\r
 /* Task function prototypes. */\r
 static void prvCheckTask( void *pvParameters );\r
 \r
@@ -420,7 +426,6 @@ void *pvAllocated;
        timer. */\r
        prvDemonstrateTimerQueryFunctions();\r
 \r
-\r
        /* If xMutexToDelete has not already been deleted, then delete it now.\r
        This is done purely to demonstrate the use of, and test, the\r
        vSemaphoreDelete() macro.  Care must be taken not to delete a semaphore\r
@@ -448,13 +453,19 @@ void *pvAllocated;
 \r
        /* Exit after a fixed time so code coverage results are written to the\r
        disk. */\r
-       #if( configCOVERAGE_TEST == 1 )\r
+       #if( projCOVERAGE_TEST == 1 )\r
        {\r
-               const TickType_t xMaxRunTime = pdMS_TO_TICKS( 60000UL );\r
+               const TickType_t xMaxRunTime = pdMS_TO_TICKS( 30000UL );\r
+\r
+               /* Exercise code not otherwise executed by standard demo/test tasks. */\r
+               if( xRunCodeCoverageTestAdditions() != pdPASS )\r
+               {\r
+                       pcStatusMessage = "Code coverage additions failed.\r\n";\r
+               }\r
 \r
-               if( xTaskGetTickCount() >= xMaxRunTime )\r
+               if( ( xTaskGetTickCount() - configINITIAL_TICK_COUNT ) >= xMaxRunTime )\r
                {\r
-                       exit( 0 );\r
+                       vTaskEndScheduler();\r
                }\r
        }\r
        #endif\r