Skip to content

Commit 0950ee8

Browse files
committed
Update queue contention test to new test framework
1 parent b074075 commit 0950ee8

4 files changed

Lines changed: 161 additions & 151 deletions

File tree

FreeRTOS/Test/Target/boards/xmos/tests/smp/queue_contention/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ PROJECT_NAME = queue_contention
55

66
TEST_DIR = $(ROOT_XMOS)/../../tests/smp/$(PROJECT_NAME)
77
TEST_BOARD_DIR = $(ROOT_XMOS)/tests/smp/$(PROJECT_NAME)
8+
TEST_INCLUDE_DIR = $(ROOT_XMOS)/../../tests/include
89

9-
INCLUDE_DIRS = $(TEST_DIR) $(DIRS_INC_COMMON)
10+
INCLUDE_DIRS = $(TEST_DIR) $(DIRS_INC_COMMON) $(TEST_INCLUDE_DIR)
1011

1112
SOURCES_TEST_CASE = $(TEST_DIR)/$(PROJECT_NAME).c \
1213
$(TEST_BOARD_DIR)/xmos_test_runner.c

FreeRTOS/Test/Target/boards/xmos/tests/smp/queue_contention/xmos_test_runner.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,6 @@ void vRunTest( void )
6262
"testRunner",
6363
configMINIMAL_STACK_SIZE,
6464
NULL,
65-
configMAX_PRIORITIES - 2,
65+
configMAX_PRIORITIES - 1,
6666
NULL );
6767
}

FreeRTOS/Test/Target/tests/smp/lock_contention_end_to_end/lock_contention_end_to_end.c

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,18 @@
6363
#endif
6464

6565
#ifndef testTASK_WITH_AFFINITY
66-
#define testTASK_WITH_AFFINITY ( 0 )
66+
#define testTASK_WITH_AFFINITY ( 1 )
6767
#endif
6868

69-
#define testNUM_SAMPLES ( 64U )
70-
#define testNUM_ITEMS ( 64U )
69+
#define testNUM_SAMPLES ( 128U )
70+
#define testNUM_ITEMS ( 256U )
7171

72-
#define TEST_START_BIT ( 1 << ( configNUMBER_OF_CORES ) )
73-
#define TEST_END_BIT ( 1 << ( configNUMBER_OF_CORES + 1 ) )
72+
#define TEST_START_BIT ( 1 << ( configNUMBER_OF_CORES ) )
73+
#define TEST_END_BIT ( 1 << ( configNUMBER_OF_CORES + 1 ) )
7474

75-
#define TEST_BUSYLOOPING_TASK_PRIORITY ( configMAX_PRIORITIES - 2 )
76-
#define TEST_PRODUCER_PRIORITY ( configMAX_PRIORITIES - 3 )
77-
#define TEST_CONSUMER_PRIORITY ( configMAX_PRIORITIES - 4 )
75+
#define TEST_BUSYLOOPING_TASK_PRIORITY ( configMAX_PRIORITIES - 2 )
76+
#define TEST_PRODUCER_PRIORITY ( configMAX_PRIORITIES - 4 )
77+
#define TEST_CONSUMER_PRIORITY ( configMAX_PRIORITIES - 3 )
7878

7979
/*-----------------------------------------------------------*/
8080

@@ -143,7 +143,10 @@ static EventGroupHandle_t xSignalEventGroup;
143143
static void prvBusyLoopingTask( void * pvParameters )
144144
{
145145
( void ) pvParameters;
146-
for(;;);
146+
147+
for( ; ; )
148+
{
149+
}
147150
}
148151
/*-----------------------------------------------------------*/
149152

@@ -266,7 +269,7 @@ static void Test_LockContentionEndToEnd( void )
266269

267270
for( iCore = 0; iCore < testNUMBER_OF_CORES; iCore++ )
268271
{
269-
printf( "Core %d: %d\n", iCore, ( int )( uxElapsedCumulative[ iCore ] / testNUM_SAMPLES ) );
272+
printf( "Core %d: %d\n", iCore, ( int ) ( uxElapsedCumulative[ iCore ] / testNUM_SAMPLES ) );
270273
}
271274
}
272275
/*-----------------------------------------------------------*/
@@ -333,15 +336,15 @@ testSETUP_FUNCTION_PROTOTYPE( setUp )
333336
}
334337

335338
#if ( testTASK_WITH_AFFINITY == 0 )
336-
for( ;i < configNUMBER_OF_CORES; i++ )
337-
{
338-
xRet = xTaskCreate( prvBusyLoopingTask,
339-
"busy",
340-
configMINIMAL_STACK_SIZE * 4,
341-
( void * ) ( i ),
342-
TEST_BUSYLOOPING_TASK_PRIORITY,
343-
&xBusyLoopingTaskHandles[ i - testNUMBER_OF_CORES ] );
344-
}
339+
for( ; i < configNUMBER_OF_CORES; i++ )
340+
{
341+
xRet = xTaskCreate( prvBusyLoopingTask,
342+
"busy",
343+
configMINIMAL_STACK_SIZE * 4,
344+
( void * ) ( i ),
345+
TEST_BUSYLOOPING_TASK_PRIORITY,
346+
&xBusyLoopingTaskHandles[ i - testNUMBER_OF_CORES ] );
347+
}
345348
#endif
346349
}
347350
/*-----------------------------------------------------------*/
@@ -360,10 +363,10 @@ testTEARDOWN_FUNCTION_PROTOTYPE( tearDown )
360363
}
361364

362365
#if ( testTASK_WITH_AFFINITY == 0 )
363-
for( ;i < configNUMBER_OF_CORES; i++ )
364-
{
365-
vTaskDelete( &xBusyLoopingTaskHandles[ i - testNUMBER_OF_CORES ] );
366-
}
366+
for( ; i < configNUMBER_OF_CORES; i++ )
367+
{
368+
vTaskDelete( &xBusyLoopingTaskHandles[ i - testNUMBER_OF_CORES ] );
369+
}
367370
#endif
368371
}
369372
/*-----------------------------------------------------------*/

0 commit comments

Comments
 (0)