sched/hrtimer: relocate the hrtimer test to simplify.

This commit relocated the hrtimer test to simplify the code.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit is contained in:
ouyangxiangzhen 2026-01-29 16:13:52 +08:00 committed by Matteo Golin
parent e69f9e902b
commit 1c0281be15
4 changed files with 21 additions and 22 deletions

View file

@ -157,16 +157,15 @@ if(CONFIG_TESTING_OSTEST)
list(APPEND SRCS nxevent.c)
endif()
if(CONFIG_HRTIMER AND CONFIG_BUILD_FLAT)
list(APPEND SRCS hrtimer.c)
endif()
if(CONFIG_ARCH_HAVE_PERF_EVENTS)
list(APPEND SRCS perf_gettime.c)
endif()
if(CONFIG_BUILD_FLAT)
list(APPEND SRCS wdog.c spinlock.c)
if(CONFIG_HRTIMER)
list(APPEND SRCS hrtimer.c)
endif()
endif()
set(OSTEST_SRCS ostest_main.c ${SRCS})

View file

@ -160,18 +160,16 @@ CSRCS += nxevent.c
endif
endif
ifeq ($(CONFIG_HRTIMER),y)
ifeq ($(CONFIG_BUILD_FLAT),y)
CSRCS += hrtimer.c
endif
endif
ifeq ($(CONFIG_ARCH_HAVE_PERF_EVENTS),y)
CSRCS += perf_gettime.c
endif
ifeq ($(CONFIG_BUILD_FLAT),y)
CSRCS += wdog.c spinlock.c
ifeq ($(CONFIG_HRTIMER),y)
CSRCS += hrtimer.c
endif
endif
include $(APPDIR)/Application.mk

View file

@ -215,6 +215,12 @@ void suspend_test(void);
void wdog_test(void);
/* hrtimer.c ****************************************************************/
#ifdef CONFIG_HRTIMER
void hrtimer_test(void);
#endif
/* posixtimers.c ************************************************************/
void timer_test(void);
@ -314,8 +320,4 @@ int sem_nfreeholders(void);
void nxevent_test(void);
#endif
#if defined(CONFIG_HRTIMER) && defined(CONFIG_BUILD_FLAT)
void hrtimer_test(void);
#endif
#endif /* __APPS_TESTING_OSTEST_OSTEST_H */

View file

@ -555,6 +555,14 @@ static int user_main(int argc, char *argv[])
printf("\nuser_main: wdog test\n");
wdog_test();
check_test_memory_usage();
/* Verify hrtimer */
# ifdef CONFIG_HRTIMER
printf("\nuser_main: hrtimer test\n");
hrtimer_test();
check_test_memory_usage();
# endif
#endif
#if !defined(CONFIG_DISABLE_POSIX_TIMERS) && \
@ -643,14 +651,6 @@ static int user_main(int argc, char *argv[])
check_test_memory_usage();
#endif
#if defined(CONFIG_HRTIMER) && defined(CONFIG_BUILD_FLAT)
/* Verify hrtimer */
printf("\nuser_main: hrtimer test\n");
hrtimer_test();
check_test_memory_usage();
#endif
/* Compare memory usage at time ostest_main started until
* user_main exits. These should not be identical, but should
* be similar enough that we can detect any serious OS memory