You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2023/01/25 21:45:35 UTC
[nuttx-apps] branch master updated: [system/argtable3] Add test suite for argtable3
This is an automated email from the ASF dual-hosted git repository.
pkarashchenko 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 53491d4f0 [system/argtable3] Add test suite for argtable3
53491d4f0 is described below
commit 53491d4f0ca37910f202790c4db2d4f4441cc63c
Author: panran <pa...@xiaomi.com>
AuthorDate: Wed Nov 16 13:13:00 2022 +0800
[system/argtable3] Add test suite for argtable3
---
system/argtable3/Kconfig | 24 ++++++++++++++++++++++++
system/argtable3/Makefile | 22 ++++++++++++++++++++++
2 files changed, 46 insertions(+)
diff --git a/system/argtable3/Kconfig b/system/argtable3/Kconfig
index 4f9958175..57ef044d1 100644
--- a/system/argtable3/Kconfig
+++ b/system/argtable3/Kconfig
@@ -15,4 +15,28 @@ config SYSTEM_ARGTABLE3_VERSION
string "ARGTABLE3 Version"
default "3.2.0.7402e6e"
+config SYSTEM_ARGTABLE3_TEST
+ tristate "System Argtable3 Test"
+ default n
+ ---help---
+ test application for argtable3
+
+if SYSTEM_ARGTABLE3_TEST
+
+config SYSTEM_ARGTABLE3_TEST_PROGNAME
+ string "Test program name"
+ default "argtable3_test"
+ ---help---
+ Argtable3 test application name
+
+config SYSTEM_ARGTABLE3_TEST_PRIORITY
+ int "Test application priority"
+ default 100
+
+config SYSTEM_ARGTABLE3_TEST_STACKSIZE
+ int "Test application stack size"
+ default DEFAULT_TASK_STACKSIZE
+
+endif
+
endif
diff --git a/system/argtable3/Makefile b/system/argtable3/Makefile
index 307415381..d2daf46aa 100644
--- a/system/argtable3/Makefile
+++ b/system/argtable3/Makefile
@@ -24,6 +24,7 @@ ARGTABLE3_VERSION := $(patsubst "%",%,$(CONFIG_SYSTEM_ARGTABLE3_VERSION))
ARGTABLE3_TARBALL = v$(ARGTABLE3_VERSION).tar.gz
ARGTABLE3_UNPACK = argtable3
ARGTABLE3_SRCDIR = $(ARGTABLE3_UNPACK)$(DELIM)src
+ARGTABLE3_TESTSDIR = $(ARGTABLE3_UNPACK)$(DELIM)tests
DEPPATH += --dep-path $(ARGTABLE3_SRCDIR)
VPATH += :$(ARGTABLE3_SRCDIR)
@@ -31,6 +32,27 @@ VPATH += :$(ARGTABLE3_SRCDIR)
CFLAGS += ${DEFINE_PREFIX}ARG_REPLACE_GETOPT=0
CSRCS := $(notdir $(wildcard $(ARGTABLE3_SRCDIR)$(DELIM)*.c))
+ifneq ($(CONFIG_SYSTEM_ARGTABLE3_TEST),)
+VPATH += $(ARGTABLE3_TESTSDIR)
+MAINSRC += testall.c
+
+CSRCS += testargdbl.c
+CSRCS += testarghashtable.c
+CSRCS += testargrex.c
+CSRCS += CuTest.c
+CSRCS += testargcmd.c
+CSRCS += testargdstr.c
+CSRCS += testargint.c
+CSRCS += testargstr.c
+CSRCS += testargdate.c
+CSRCS += testargfile.c
+CSRCS += testarglit.c
+
+PROGNAME += $(CONFIG_SYSTEM_ARGTABLE3_TEST_PROGNAME)
+PRIORITY += $(CONFIG_SYSTEM_ARGTABLE3_TEST_PRIORITY)
+STACKSIZE += $(CONFIG_SYSTEM_ARGTABLE3_TEST_STACKSIZE)
+endif
+
# workaround for clang.
#
# argtable3/src/arg_rex.c:100:104: error: unknown attribute 'optimize' ignored [-Werror,-Wunknown-attributes]