mirror of
https://github.com/meshtastic/firmware.git
synced 2025-07-30 02:15:41 +00:00
Guards
This commit is contained in:
parent
685a478797
commit
90a3000d58
@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
#ifdef ARCH_PORTDUINO
|
#ifdef ARCH_PORTDUINO
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
#include "modules/SerialModule.h"
|
|
||||||
|
|
||||||
#if defined(UNIT_TEST)
|
#if defined(UNIT_TEST)
|
||||||
#define IS_RUNNING_TESTS 1
|
#define IS_RUNNING_TESTS 1
|
||||||
@ -12,6 +11,14 @@
|
|||||||
#define IS_RUNNING_TESTS 0
|
#define IS_RUNNING_TESTS 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if (defined(ARCH_ESP32) || defined(ARCH_NRF52) || defined(ARCH_RP2040)) && !defined(CONFIG_IDF_TARGET_ESP32S2) && \
|
||||||
|
!defined(CONFIG_IDF_TARGET_ESP32C3)
|
||||||
|
#include "modules/SerialModule.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (defined(ARCH_ESP32) || defined(ARCH_NRF52) || defined(ARCH_RP2040)) && !defined(CONFIG_IDF_TARGET_ESP32S2) && \
|
||||||
|
!defined(CONFIG_IDF_TARGET_ESP32C3)
|
||||||
|
|
||||||
// Test that empty configuration is valid.
|
// Test that empty configuration is valid.
|
||||||
void test_serialConfigEmptyIsValid(void)
|
void test_serialConfigEmptyIsValid(void)
|
||||||
{
|
{
|
||||||
@ -112,10 +119,14 @@ void test_serialConfigVariousModesWithoutOverrideAreValid(void)
|
|||||||
TEST_ASSERT_TRUE(SerialModule::isValidConfig(config));
|
TEST_ASSERT_TRUE(SerialModule::isValidConfig(config));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // Architecture check
|
||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
initializeTestEnvironment();
|
initializeTestEnvironment();
|
||||||
|
|
||||||
|
#if (defined(ARCH_ESP32) || defined(ARCH_NRF52) || defined(ARCH_RP2040)) && !defined(CONFIG_IDF_TARGET_ESP32S2) && \
|
||||||
|
!defined(CONFIG_IDF_TARGET_ESP32C3)
|
||||||
UNITY_BEGIN();
|
UNITY_BEGIN();
|
||||||
RUN_TEST(test_serialConfigEmptyIsValid);
|
RUN_TEST(test_serialConfigEmptyIsValid);
|
||||||
RUN_TEST(test_serialConfigEnabledIsValid);
|
RUN_TEST(test_serialConfigEnabledIsValid);
|
||||||
@ -127,6 +138,11 @@ void setup()
|
|||||||
RUN_TEST(test_serialConfigWithOverrideConsoleProtoModeIsInvalid);
|
RUN_TEST(test_serialConfigWithOverrideConsoleProtoModeIsInvalid);
|
||||||
RUN_TEST(test_serialConfigVariousModesWithoutOverrideAreValid);
|
RUN_TEST(test_serialConfigVariousModesWithoutOverrideAreValid);
|
||||||
exit(UNITY_END());
|
exit(UNITY_END());
|
||||||
|
#else
|
||||||
|
LOG_WARN("This test requires ESP32, NRF52, or RP2040 architecture");
|
||||||
|
UNITY_BEGIN();
|
||||||
|
UNITY_END();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
void setup()
|
void setup()
|
||||||
|
Loading…
Reference in New Issue
Block a user