Skip to content

Commit afc1b31

Browse files
committed
Merge branch 'test/freertos_gptimer_not_supported' into 'master'
test(freertos): allow freertos tests to compile even when gptimer is not supported Closes IDF-11554 See merge request espressif/esp-idf!36461
2 parents 8dfcafa + 2ef05f9 commit afc1b31

File tree

9 files changed

+39
-6
lines changed

9 files changed

+39
-6
lines changed

components/freertos/test_apps/freertos/kernel/event_groups/test_freertos_eventgroups.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ TEST_CASE("FreeRTOS Event Groups do not cause priority inversion when higher pri
185185

186186
/*-----------------Test case for event group trace facilities-----------------*/
187187
#ifdef CONFIG_FREERTOS_USE_TRACE_FACILITY
188+
#if SOC_GPTIMER_SUPPORTED
188189
/*
189190
* Test event group Trace Facility functions such as
190191
* xEventGroupClearBitsFromISR(), xEventGroupSetBitsFromISR()
@@ -261,4 +262,5 @@ TEST_CASE("FreeRTOS Event Group ISR", "[freertos]")
261262
vSemaphoreDelete(done_sem);
262263
vTaskDelay(10); //Give time for idle task to clear up deleted tasks
263264
}
265+
#endif //SOC_GPTIMER_SUPPORTED
264266
#endif //CONFIG_FREERTOS_USE_TRACE_FACILITY

components/freertos/test_apps/freertos/kernel/tasks/test_freertos_task_notify.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -21,6 +21,8 @@
2121
#include "unity.h"
2222
#include "test_utils.h"
2323

24+
#if SOC_GPTIMER_SUPPORTED
25+
2426
#define NO_OF_NOTIFS 4
2527
#define NO_OF_TASKS 2 //Sender and receiver
2628
#define MESSAGE 0xFF
@@ -196,9 +198,10 @@ TEST_CASE("Test Task_Notify", "[freertos]")
196198
TEST_ESP_OK(gptimer_del_timer(gptimers[i]));
197199
}
198200
}
201+
#endif //SOC_GPTIMER_SUPPORTED
199202

200203
/* Test causes asserts, so it cannot be run as a normal unity test case.
201-
Test case is ran as a seperate test case in test_task_notify_too_high_index_fails
204+
Test case is ran as a separate test case in test_task_notify_too_high_index_fails
202205
*/
203206
TEST_CASE("Notify too high index fails", "[ignore]")
204207
{
@@ -207,7 +210,7 @@ TEST_CASE("Notify too high index fails", "[ignore]")
207210
}
208211

209212
/* Test causes asserts, so it cannot be run as a normal unity test case.
210-
Test case is ran as a seperate test case in test_task_notify_wait_too_high_index_fails
213+
Test case is ran as a separate test case in test_task_notify_wait_too_high_index_fails
211214
*/
212215
TEST_CASE("Notify Wait too high index fails", "[ignore]")
213216
{

components/freertos/test_apps/freertos/kernel/tasks/test_task_delay.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "portTestMacro.h"
1414

1515
/* ------------------------------------------------------------------------------------------------------------------ */
16+
#if SOC_GPTIMER_SUPPORTED
1617

1718
/*
1819
Test vTaskDelay
@@ -178,3 +179,4 @@ TEST_CASE("Tasks: Test vTaskDelayUntil", "[freertos]")
178179
}
179180

180181
#endif /* ( INCLUDE_xTaskDelayUntil == 1 ) */
182+
#endif //SOC_GPTIMER_SUPPORTED

components/freertos/test_apps/freertos/kernel/tasks/test_task_suspend_resume.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ TEST_CASE("Suspend the current running task", "[freertos]")
118118
TEST_ASSERT_TRUE(resumed);
119119
}
120120

121+
#if SOC_GPTIMER_SUPPORTED
122+
121123
static volatile bool timer_isr_fired;
122124
static gptimer_handle_t gptimer = NULL;
123125

@@ -203,3 +205,5 @@ TEST_CASE("Resume task from ISR (other core)", "[freertos]")
203205
test_resume_task_from_isr(!UNITY_FREERTOS_CPU);
204206
}
205207
#endif // CONFIG_FREERTOS_UNICORE
208+
209+
#endif //SOC_GPTIMER_SUPPORTED

components/freertos/test_apps/freertos/kernel/tasks/test_vTaskSuspendAll_xTaskResumeAll.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -24,6 +24,8 @@ GP timer is used to trigger an interrupt. Test cases will register an interrupt
2424
interrupt callback. The functions below simply the interrupt registration/trigger/deregistration process.
2525
*/
2626

27+
#if SOC_GPTIMER_SUPPORTED
28+
2729
static gptimer_handle_t gptimer = NULL;
2830
static bool (*registered_intr_callback)(void *) = NULL;
2931

@@ -84,6 +86,8 @@ static void deregister_intr_cb(void)
8486
TEST_ESP_OK(gptimer_del_timer(gptimer_temp));
8587
}
8688

89+
#endif //SOC_GPTIMER_SUPPORTED
90+
8791
/* ---------------------------------------------------------------------------------------------------------------------
8892
Test vTaskSuspendAll() and xTaskResumeAll() basic
8993
@@ -265,6 +269,9 @@ Only runs on !CONFIG_FREERTOS_UNICORE
265269
--------------------------------------------------------------------------------------------------------------------- */
266270

267271
#if !CONFIG_FREERTOS_UNICORE
272+
273+
#if SOC_GPTIMER_SUPPORTED
274+
268275
static volatile int test_unblk_sync;
269276
static SemaphoreHandle_t test_unblk_done_sem;
270277

@@ -394,6 +401,8 @@ TEST_CASE("Test vTaskSuspendAll allows scheduling on other cores", "[freertos]")
394401
vTaskDelay(10);
395402
}
396403

404+
#endif //SOC_GPTIMER_SUPPORTED
405+
397406
/* ---------------------------------------------------------------------------------------------------------------------
398407
Test vTaskSuspendAll doesn't block unpinned tasks from being scheduled on other cores
399408
@@ -539,6 +548,8 @@ Test xTaskResumeAll() resumes pended tasks on the current core
539548

540549
#define TEST_PENDED_NUM_BLOCKED_TASKS 4
541550

551+
#if SOC_GPTIMER_SUPPORTED
552+
542553
static bool test_pended_isr(void *arg)
543554
{
544555
TaskHandle_t *blkd_tsks = (TaskHandle_t *)arg;
@@ -639,6 +650,8 @@ TEST_CASE("Test xTaskResumeAll resumes pended tasks", "[freertos]")
639650
vTaskDelay(10);
640651
}
641652

653+
#endif //SOC_GPTIMER_SUPPORTED
654+
642655
/* ---------------------------------------------------------------------------------------------------------------------
643656
Test xTaskSuspendAll on both cores pends all tasks and xTaskResumeAll on both cores resumes all tasks
644657

components/freertos/test_apps/freertos/pytest_freertos.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# TODO: [ESP32C61] IDF-11146
1414
pytest.param('smp', marks=[
1515
pytest.mark.supported_targets,
16-
pytest.mark.temp_skip_ci(targets=['esp32p4', 'esp32c5', 'esp32c61'],
16+
pytest.mark.temp_skip_ci(targets=['esp32p4', 'esp32c5', 'esp32c61', 'esp32h21'],
1717
reason='test failed/TBD IDF-8113')
1818
]),
1919
]

components/idf_test/include/esp32h21/.gitkeep

Whitespace-only changes.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#pragma once
8+
9+
#define IDF_PERFORMANCE_MAX_ESP_TIMER_GET_TIME_PER_CALL 1900

tools/unit-test-app/components/test_utils/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if(CONFIG_IDF_TARGET_ESP32)
1111
# where PCNT can count the pulses generated by RMT, and RMT is clocked from REF_TICK
1212
# REF_TICK won't be affected by DFS
1313
list(APPEND srcs "ref_clock_impl_rmt_pcnt.c")
14-
else()
14+
elseif(CONFIG_SOC_GPTIMER_SUPPORTED)
1515
list(APPEND srcs "ref_clock_impl_timergroup.c")
1616
endif()
1717

0 commit comments

Comments
 (0)