mirror of
https://github.com/espressif/openthread.git
synced 2026-08-10 12:47:47 +00:00
[tests] add conditionals around unit tests (#3616)
This commit is contained in:
+4
-1
@@ -48,10 +48,13 @@ PRETTY_SUBDIRS = \
|
||||
unit \
|
||||
$(NULL)
|
||||
|
||||
SUBDIRS += \
|
||||
unit \
|
||||
$(NULL)
|
||||
|
||||
if OPENTHREAD_POSIX
|
||||
if OPENTHREAD_ENABLE_CLI
|
||||
SUBDIRS += \
|
||||
unit \
|
||||
scripts \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
+33
-21
@@ -69,28 +69,25 @@ AM_CPPFLAGS += \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
COMMON_LDADD = \
|
||||
$(NULL)
|
||||
|
||||
if OPENTHREAD_ENABLE_NCP
|
||||
|
||||
COMMON_LDADD = \
|
||||
COMMON_LDADD += \
|
||||
$(top_builddir)/src/ncp/libopenthread-ncp-ftd.a \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
COMMON_LDADD += \
|
||||
$(top_builddir)/src/core/libopenthread-ftd.a \
|
||||
-lpthread \
|
||||
$(NULL)
|
||||
|
||||
else
|
||||
|
||||
COMMON_LDADD = \
|
||||
$(top_builddir)/src/core/libopenthread-ftd.a \
|
||||
-lpthread \
|
||||
$(NULL)
|
||||
|
||||
endif # OPENTHREAD_ENABLE_NCP
|
||||
|
||||
if OPENTHREAD_ENABLE_BUILTIN_MBEDTLS
|
||||
COMMON_LDADD += \
|
||||
$(top_builddir)/third_party/mbedtls/libmbedcrypto.a \
|
||||
$(NULL)
|
||||
endif # OPENTHREAD_ENABLE_BUILTIN_MBEDTLS
|
||||
endif
|
||||
|
||||
if OPENTHREAD_ENABLE_POSIX_APP
|
||||
COMMON_LDADD += \
|
||||
@@ -101,10 +98,14 @@ endif
|
||||
# Test applications that should be run when the 'check' target is run.
|
||||
|
||||
check_PROGRAMS = \
|
||||
test-toolchain \
|
||||
$(NULL)
|
||||
|
||||
if OPENTHREAD_ENABLE_FTD
|
||||
check_PROGRAMS += \
|
||||
test-aes \
|
||||
test-child \
|
||||
test-child-table \
|
||||
test-hdlc \
|
||||
test-heap \
|
||||
test-hmac-sha256 \
|
||||
test-link-quality \
|
||||
@@ -114,25 +115,36 @@ check_PROGRAMS = \
|
||||
test-message-queue \
|
||||
test-network-data \
|
||||
test-priority-queue \
|
||||
test-pskc \
|
||||
test-spinel-decoder \
|
||||
test-spinel-encoder \
|
||||
test-string \
|
||||
test-strlcat \
|
||||
test-strlcpy \
|
||||
test-strnlen \
|
||||
test-timer \
|
||||
test-toolchain \
|
||||
$(NULL)
|
||||
|
||||
XFAIL_TESTS = \
|
||||
if OPENTHREAD_ENABLE_COMMISSIONER
|
||||
check_PROGRAMS += \
|
||||
test-pskc \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
if OPENTHREAD_ENABLE_NCP
|
||||
check_PROGRAMS += \
|
||||
test-ncp-buffer \
|
||||
test-spinel-decoder \
|
||||
test-spinel-encoder \
|
||||
$(NULL)
|
||||
|
||||
if OPENTHREAD_ENABLE_NCP_UART
|
||||
check_PROGRAMS += \
|
||||
test-hdlc \
|
||||
$(NULL)
|
||||
endif
|
||||
endif
|
||||
endif # OPENTHREAD_ENABLE_FTD
|
||||
|
||||
XFAIL_TESTS = \
|
||||
$(NULL)
|
||||
endif # OPENTHREAD_ENABLE_NCP
|
||||
|
||||
if OPENTHREAD_WITH_ADDRESS_SANITIZER
|
||||
check_PROGRAMS += test-address-sanitizer
|
||||
@@ -223,8 +235,8 @@ test_spinel_encoder_SOURCES = test_platform.cpp test_spinel_encoder.cpp
|
||||
test_timer_LDADD = $(COMMON_LDADD)
|
||||
test_timer_SOURCES = test_platform.cpp test_timer.cpp
|
||||
|
||||
test_toolchain_LDADD = $(COMMON_LDADD)
|
||||
test_toolchain_SOURCES = test_platform.cpp test_toolchain.cpp test_toolchain_c.c
|
||||
test_toolchain_LDADD = $(NULL)
|
||||
test_toolchain_SOURCES = test_toolchain.cpp test_toolchain_c.c
|
||||
|
||||
PRETTY_FILES = \
|
||||
$(test_address_sanitizer_SOURCES) \
|
||||
|
||||
@@ -190,7 +190,7 @@ static void Test(TestIphcVector &aVector, bool aCompress, bool aDecompress)
|
||||
|
||||
if (aVector.mError == OT_ERROR_NONE)
|
||||
{
|
||||
uint8_t compressBytes = buffer.GetWritePointer() - result;
|
||||
uint8_t compressBytes = static_cast<uint8_t>(buffer.GetWritePointer() - result);
|
||||
|
||||
// Append payload to the LOWPAN_IPHC.
|
||||
message->Read(message->GetOffset(), message->GetLength() - message->GetOffset(), result + compressBytes);
|
||||
|
||||
Reference in New Issue
Block a user