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


The following commit(s) were added to refs/heads/master by this push:
     new a5a93c0a1 stressapptest: Add download step
a5a93c0a1 is described below

commit a5a93c0a1742bcc8496f2eba23b1759281d24500
Author: wangmingrong1 <wangmingro...@xiaomi.com>
AuthorDate: Fri Jan 10 18:02:39 2025 +0800

    stressapptest: Add download step
    
    Signed-off-by: wangmingrong1 <wangmingro...@xiaomi.com>
---
 testing/stressapptest/CMakeLists.txt | 34 ++++++++++++++++++++++++++++++++++
 testing/stressapptest/Kconfig        |  4 ++++
 testing/stressapptest/Makefile       | 15 +++++++++++++++
 3 files changed, 53 insertions(+)

diff --git a/testing/stressapptest/CMakeLists.txt 
b/testing/stressapptest/CMakeLists.txt
index c9c075d3d..4a618c2a0 100644
--- a/testing/stressapptest/CMakeLists.txt
+++ b/testing/stressapptest/CMakeLists.txt
@@ -22,6 +22,40 @@
 
 if(CONFIG_TESTING_STRESSAPPTEST)
 
+  set(STRESSAPPTEST_DIR ${CMAKE_CURRENT_LIST_DIR}/stressapptest)
+
+  if(NOT EXISTS ${STRESSAPPTEST_DIR})
+
+    set(STRESSAPPTEST_VERSION ${CONFIG_TESTING_STRESSAPPTEST_VERSION})
+
+    FetchContent_Declare(
+      stressapptest
+      DOWNLOAD_NAME "v${STRESSAPPTEST_VERSION}.tar.gz"
+      DOWNLOAD_DIR ${CMAKE_CURRENT_LIST_DIR}
+      URL 
"https://github.com/stressapptest/stressapptest/archive/refs/tags/v${STRESSAPPTEST_VERSION}.tar.gz";
+          SOURCE_DIR
+          ${CMAKE_CURRENT_LIST_DIR}/stressapptest
+          BINARY_DIR
+          ${CMAKE_BINARY_DIR}/stressapptest
+          CONFIGURE_COMMAND
+          ""
+          BUILD_COMMAND
+          ""
+          INSTALL_COMMAND
+          ""
+          TEST_COMMAND
+          ""
+      DOWNLOAD_NO_PROGRESS true
+      TIMEOUT 30)
+
+    FetchContent_GetProperties(stressapptest)
+
+    if(NOT stressapptest_POPULATED)
+      FetchContent_Populate(stressapptest)
+    endif()
+
+  endif()
+
   set(SRC_DIR ${CMAKE_CURRENT_LIST_DIR}/stressapptest/src)
 
   set(SRCS
diff --git a/testing/stressapptest/Kconfig b/testing/stressapptest/Kconfig
index 91f59eba1..c56aeeae5 100644
--- a/testing/stressapptest/Kconfig
+++ b/testing/stressapptest/Kconfig
@@ -16,6 +16,10 @@ config TESTING_STRESSAPPTEST
 
 if TESTING_STRESSAPPTEST
 
+config TESTING_STRESSAPPTEST_VERSION
+       string "Version of stressapptest"
+       default "1.0.11"
+
 config TESTING_STRESSAPPTEST_PRIORITY
        int "Priority of stressapptest process"
        default 100
diff --git a/testing/stressapptest/Makefile b/testing/stressapptest/Makefile
index 2cc05d507..e12486043 100644
--- a/testing/stressapptest/Makefile
+++ b/testing/stressapptest/Makefile
@@ -22,6 +22,21 @@
 
 include $(APPDIR)/Make.defs
 
+STRESSAPPTEST_VERSION=$(patsubst "%",%,$(CONFIG_TESTING_STRESSAPPTEST_VERSION))
+
+v$(STRESSAPPTEST_VERSION).tar.gz:
+       $(call 
DOWNLOAD,https://github.com/stressapptest/stressapptest/archive/refs/tags/,$@)
+
+stressapptest: v$(STRESSAPPTEST_VERSION).tar.gz
+       $(Q) tar -xf $<
+       $(Q) mv stressapptest-$(STRESSAPPTEST_VERSION) stressapptest
+
+context:: stressapptest
+
+distclean::
+       $(Q) $(DELFILE) v$(STRESSAPPTEST_VERSION).tar.gz
+       $(call DELDIR, stressapptest)
+
 VPATH   += stressapptest
 VPATH   += stressapptest/src
 DEPPATH += --dep-path stressapptest

Reply via email to