mirror of
https://github.com/espressif/esp-idf.git
synced 2026-05-05 20:35:08 +02:00
unit test: adapt tests to single core configuration
This commit is contained in:
@@ -46,7 +46,9 @@ TEST_CASE("xPortInIsrContext test", "[freertos]")
|
||||
{
|
||||
xTaskCreatePinnedToCore(testthread, "tst" , 4096, NULL, 3, NULL, 0);
|
||||
vTaskDelay(150 / portTICK_PERIOD_MS);
|
||||
#if portNUM_PROCESSORS == 2
|
||||
xTaskCreatePinnedToCore(testthread, "tst" , 4096, NULL, 3, NULL, 1);
|
||||
vTaskDelay(150 / portTICK_PERIOD_MS);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ TEST_CASE("Test for per-task non-reentrant tasks", "[freertos]")
|
||||
error = 0;
|
||||
xTaskCreatePinnedToCore(tskTestRand, "tsk1", 2048, (void *)100, 3, NULL, 0);
|
||||
xTaskCreatePinnedToCore(tskTestRand, "tsk2", 2048, (void *)200, 3, NULL, 0);
|
||||
xTaskCreatePinnedToCore(tskTestRand, "tsk3", 2048, (void *)300, 3, NULL, 1);
|
||||
xTaskCreatePinnedToCore(tskTestRand, "tsk3", 2048, (void *)300, 3, NULL, portNUM_PROCESSORS - 1);
|
||||
xTaskCreatePinnedToCore(tskTestRand, "tsk4", 2048, (void *)400, 3, NULL, 0);
|
||||
while (done != 4) {
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
|
||||
@@ -72,6 +72,7 @@ TEST_CASE("Yield from lower priority task, same CPU", "[freertos]")
|
||||
}
|
||||
|
||||
|
||||
#if portNUM_PROCESSORS == 2
|
||||
TEST_CASE("Yield from lower priority task, other CPU", "[freertos]")
|
||||
{
|
||||
uint32_t trigger_ccount, yield_ccount, now_ccount, delta;
|
||||
@@ -106,3 +107,4 @@ TEST_CASE("Yield from lower priority task, other CPU", "[freertos]")
|
||||
vTaskDelete(sender_task);
|
||||
}
|
||||
}
|
||||
#endif // portNUM_PROCESSORS == 2
|
||||
|
||||
@@ -62,6 +62,8 @@ TEST_CASE("portMUX recursive locks (no contention)", "[freertos]")
|
||||
BENCHMARK_END("no contention recursive");
|
||||
}
|
||||
|
||||
#if portNUM_PROCESSORS == 2
|
||||
|
||||
static volatile int shared_value;
|
||||
static portMUX_TYPE shared_mux;
|
||||
static xSemaphoreHandle done_sem;
|
||||
@@ -130,4 +132,5 @@ TEST_CASE("portMUX high contention", "[freertos]")
|
||||
TEST_ASSERT_EQUAL_INT(REPEAT_OPS * TOTAL_TASKS, shared_value);
|
||||
}
|
||||
|
||||
#endif // portNUM_PROCESSORS == 2
|
||||
|
||||
|
||||
Reference in New Issue
Block a user