Skip to content

Commit fe8a3b9

Browse files
Build the quickjs unit test framework by generating a ROMFS image
Signed-off-by: liaozhiwei <[email protected]>
1 parent 4e96470 commit fe8a3b9

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

interpreters/quickjs/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,18 @@ if(CONFIG_INTERPRETERS_QUICKJS)
135135
list(APPEND QUICKJS_CSRCS ${QUICKJS_DIR}/quickjs-libc.c)
136136
endif()
137137

138+
if(CONFIG_INTERPRETERS_QUICKJS_TEST)
139+
add_custom_target(
140+
qjstest_img
141+
COMMAND genromfs -f ${CMAKE_BINARY_DIR}/etc/qjstest.img -d
142+
${QUICKJS_DIR}/tests -V "ROMFS_Test"
143+
WORKING_DIRECTORY ${QUICKJS_DIR}
144+
COMMENT "QUICKJS UNIT TEST Generating qjstest.img...")
145+
146+
add_dynamic_rcraws(RAWS ${CMAKE_BINARY_DIR}/etc/qjstest.img DEPENDS
147+
qjstest_img)
148+
endif()
149+
138150
nuttx_add_library(libqjs)
139151
target_sources(libqjs PRIVATE ${QUICKJS_CSRCS})
140152
target_include_directories(libqjs PRIVATE ${QUICKJS_INCDIR})

interpreters/quickjs/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,8 @@ config INTERPRETERS_QUICKJS_CPUPROFILING
7272
bool "Enable QUICKJS_CPUPROFILING"
7373
default n
7474

75+
config INTERPRETERS_QUICKJS_TEST
76+
bool "Enable QuickJS test"
77+
default n
78+
7579
endif # INTERPRETERS_QUICKJS

0 commit comments

Comments
 (0)