This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit 54a8915f2992879cfca106a207943a4c8d113d02
Author: zhangyuan29 <[email protected]>
AuthorDate: Mon Jul 22 10:40:33 2024 +0800

    ostest: test wdog only in flat mode
    
    Signed-off-by: zhangyuan29 <[email protected]>
---
 testing/ostest/CMakeLists.txt | 7 +++++--
 testing/ostest/Makefile       | 6 +++++-
 testing/ostest/ostest_main.c  | 2 +-
 testing/ostest/wdog.c         | 2 +-
 4 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/testing/ostest/CMakeLists.txt b/testing/ostest/CMakeLists.txt
index 92adb6991..47db29f77 100644
--- a/testing/ostest/CMakeLists.txt
+++ b/testing/ostest/CMakeLists.txt
@@ -27,8 +27,7 @@ if(CONFIG_TESTING_OSTEST)
       sigprocmask.c
       sighand.c
       signest.c
-      sighelper.c
-      wdog.c)
+      sighelper.c)
 
   if(CONFIG_DEV_NULL)
     list(APPEND SRCS dev_null.c)
@@ -148,6 +147,10 @@ if(CONFIG_TESTING_OSTEST)
     list(APPEND SRCS nxevent.c)
   endif()
 
+  if(CONFIG_BUILD_FLAT)
+    list(APPEND SRCS wdog.c)
+  endif()
+
   set(OSTEST_SRCS ostest_main.c ${SRCS})
   nuttx_add_application(NAME ostest SRCS ${OSTEST_SRCS})
 
diff --git a/testing/ostest/Makefile b/testing/ostest/Makefile
index a430e9272..fcd04665d 100644
--- a/testing/ostest/Makefile
+++ b/testing/ostest/Makefile
@@ -30,7 +30,7 @@ MODULE = $(CONFIG_TESTING_OSTEST)
 # NuttX OS Test
 
 CSRCS   = getopt.c libc_memmem.c restart.c sigprocmask.c sighand.c \
-          signest.c sighelper.c wdog.c
+          signest.c sighelper.c
 
 MAINSRC = ostest_main.c
 
@@ -144,4 +144,8 @@ CSRCS += nxevent.c
 endif
 endif
 
+ifeq ($(CONFIG_BUILD_FLAT),y)
+CSRCS += wdog.c
+endif
+
 include $(APPDIR)/Application.mk
diff --git a/testing/ostest/ostest_main.c b/testing/ostest/ostest_main.c
index fa6e68df9..377196455 100644
--- a/testing/ostest/ostest_main.c
+++ b/testing/ostest/ostest_main.c
@@ -524,7 +524,7 @@ static int user_main(int argc, char *argv[])
       check_test_memory_usage();
 #endif
 
-#ifndef CONFIG_BUILD_KERNEL
+#ifdef CONFIG_BUILD_FLAT
       printf("\nuser_main: wdog test\n");
       wdog_test();
       check_test_memory_usage();
diff --git a/testing/ostest/wdog.c b/testing/ostest/wdog.c
index 6d3cdfecc..65a3d2a1d 100644
--- a/testing/ostest/wdog.c
+++ b/testing/ostest/wdog.c
@@ -55,7 +55,7 @@ typedef struct wdtest_param_s
  * Private Functions
  ****************************************************************************/
 
-#ifndef CONFIG_BUILD_KERNEL
+#ifdef CONFIG_BUILD_FLAT
 static void wdtest_callback(wdparm_t param)
 {
   struct timespec tp;

Reply via email to