diff --git a/user/tests/integration/00_before/000_electron_enable_external_rtc_clock/000_electron_enable_external_rtc_clock.spec.js b/user/tests/integration/00_before/000_electron_enable_external_rtc_clock/000_electron_enable_external_rtc_clock.spec.js new file mode 120000 index 0000000000..0634b1abe3 --- /dev/null +++ b/user/tests/integration/00_before/000_electron_enable_external_rtc_clock/000_electron_enable_external_rtc_clock.spec.js @@ -0,0 +1 @@ +../../../wiring/electron_rtc_clock_source/000_electron_enable_external_rtc_clock.spec.js \ No newline at end of file diff --git a/user/tests/integration/00_before/000_electron_enable_external_rtc_clock/clock.cpp b/user/tests/integration/00_before/000_electron_enable_external_rtc_clock/clock.cpp new file mode 120000 index 0000000000..3441c52bb2 --- /dev/null +++ b/user/tests/integration/00_before/000_electron_enable_external_rtc_clock/clock.cpp @@ -0,0 +1 @@ +../../../wiring/electron_rtc_clock_source/clock.cpp \ No newline at end of file diff --git a/user/tests/integration/00_before/000_electron_enable_external_rtc_clock/test_config.h b/user/tests/integration/00_before/000_electron_enable_external_rtc_clock/test_config.h new file mode 120000 index 0000000000..b6219c688d --- /dev/null +++ b/user/tests/integration/00_before/000_electron_enable_external_rtc_clock/test_config.h @@ -0,0 +1 @@ +../../../wiring/electron_rtc_clock_source/test_config_lse.h \ No newline at end of file diff --git a/user/tests/integration/00_before/001_electron_disable_external_rtc_clock/001_electron_disable_external_rtc_clock.spec.js b/user/tests/integration/00_before/001_electron_disable_external_rtc_clock/001_electron_disable_external_rtc_clock.spec.js new file mode 120000 index 0000000000..46b347d71c --- /dev/null +++ b/user/tests/integration/00_before/001_electron_disable_external_rtc_clock/001_electron_disable_external_rtc_clock.spec.js @@ -0,0 +1 @@ +../../../wiring/electron_rtc_clock_source/001_electron_disable_external_rtc_clock.spec.js \ No newline at end of file diff --git a/user/tests/integration/00_before/001_electron_disable_external_rtc_clock/clock.cpp b/user/tests/integration/00_before/001_electron_disable_external_rtc_clock/clock.cpp new file mode 120000 index 0000000000..3441c52bb2 --- /dev/null +++ b/user/tests/integration/00_before/001_electron_disable_external_rtc_clock/clock.cpp @@ -0,0 +1 @@ +../../../wiring/electron_rtc_clock_source/clock.cpp \ No newline at end of file diff --git a/user/tests/integration/00_before/001_electron_disable_external_rtc_clock/test_config.h b/user/tests/integration/00_before/001_electron_disable_external_rtc_clock/test_config.h new file mode 120000 index 0000000000..7da67b61c3 --- /dev/null +++ b/user/tests/integration/00_before/001_electron_disable_external_rtc_clock/test_config.h @@ -0,0 +1 @@ +../../../wiring/electron_rtc_clock_source/test_config_hse_lsi.h \ No newline at end of file diff --git a/user/tests/integration/00_before/electron_disable_external_rtc_clock b/user/tests/integration/00_before/electron_disable_external_rtc_clock deleted file mode 120000 index a19b45d277..0000000000 --- a/user/tests/integration/00_before/electron_disable_external_rtc_clock +++ /dev/null @@ -1 +0,0 @@ -../../wiring/electron_disable_external_rtc_clock \ No newline at end of file diff --git a/user/tests/integration/zz_after/electron_enable_external_rtc_clock b/user/tests/integration/zz_after/electron_enable_external_rtc_clock deleted file mode 120000 index 491d9cb625..0000000000 --- a/user/tests/integration/zz_after/electron_enable_external_rtc_clock +++ /dev/null @@ -1 +0,0 @@ -../../wiring/electron_enable_external_rtc_clock \ No newline at end of file diff --git a/user/tests/integration/zz_after/zzz_electron_enable_external_rtc_clock/clock.cpp b/user/tests/integration/zz_after/zzz_electron_enable_external_rtc_clock/clock.cpp new file mode 120000 index 0000000000..3441c52bb2 --- /dev/null +++ b/user/tests/integration/zz_after/zzz_electron_enable_external_rtc_clock/clock.cpp @@ -0,0 +1 @@ +../../../wiring/electron_rtc_clock_source/clock.cpp \ No newline at end of file diff --git a/user/tests/integration/zz_after/zzz_electron_enable_external_rtc_clock/test_config.h b/user/tests/integration/zz_after/zzz_electron_enable_external_rtc_clock/test_config.h new file mode 120000 index 0000000000..14e7a3512e --- /dev/null +++ b/user/tests/integration/zz_after/zzz_electron_enable_external_rtc_clock/test_config.h @@ -0,0 +1 @@ +../../../wiring/electron_rtc_clock_source/test_config_lse_validate.h \ No newline at end of file diff --git a/user/tests/integration/zz_after/zzz_electron_enable_external_rtc_clock/zzz_electron_enable_external_rtc_clock.spec.js b/user/tests/integration/zz_after/zzz_electron_enable_external_rtc_clock/zzz_electron_enable_external_rtc_clock.spec.js new file mode 120000 index 0000000000..6f30886fa2 --- /dev/null +++ b/user/tests/integration/zz_after/zzz_electron_enable_external_rtc_clock/zzz_electron_enable_external_rtc_clock.spec.js @@ -0,0 +1 @@ +../../../wiring/electron_rtc_clock_source/zzz_electron_enable_external_rtc_clock.spec.js \ No newline at end of file diff --git a/user/tests/wiring/electron_enable_external_rtc_clock/clock.cpp b/user/tests/wiring/electron_enable_external_rtc_clock/clock.cpp deleted file mode 100644 index 8ca7c272e9..0000000000 --- a/user/tests/wiring/electron_enable_external_rtc_clock/clock.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#define TEST_ELECTRON_USE_HSE_LSI (0) - -#include "../electron_disable_external_rtc_clock/clock.cpp" diff --git a/user/tests/wiring/electron_rtc_clock_source/000_electron_enable_external_rtc_clock.spec.js b/user/tests/wiring/electron_rtc_clock_source/000_electron_enable_external_rtc_clock.spec.js new file mode 100644 index 0000000000..7734d330bb --- /dev/null +++ b/user/tests/wiring/electron_rtc_clock_source/000_electron_enable_external_rtc_clock.spec.js @@ -0,0 +1,17 @@ +suite('Electron enable external RTC clock (LSE)'); + +platform('electron'); +systemThread('enabled'); + +let device = null; + +before(function() { + device = this.particle.devices[0]; +}); + +test('01_connect_set_feature_reset', async function() { + await device.reset(); +}); + +test('02_validate', async function() { +}); diff --git a/user/tests/wiring/electron_disable_external_rtc_clock/000_electron_disable_external_rtc_clock.spec.js b/user/tests/wiring/electron_rtc_clock_source/001_electron_disable_external_rtc_clock.spec.js similarity index 100% rename from user/tests/wiring/electron_disable_external_rtc_clock/000_electron_disable_external_rtc_clock.spec.js rename to user/tests/wiring/electron_rtc_clock_source/001_electron_disable_external_rtc_clock.spec.js diff --git a/user/tests/wiring/electron_disable_external_rtc_clock/clock.cpp b/user/tests/wiring/electron_rtc_clock_source/clock.cpp similarity index 90% rename from user/tests/wiring/electron_disable_external_rtc_clock/clock.cpp rename to user/tests/wiring/electron_rtc_clock_source/clock.cpp index 04b6d1bcbb..71b8680b3a 100644 --- a/user/tests/wiring/electron_disable_external_rtc_clock/clock.cpp +++ b/user/tests/wiring/electron_rtc_clock_source/clock.cpp @@ -17,6 +17,7 @@ #include "application.h" #include "test.h" +#include "test_config.h" #ifndef PARTICLE_TEST_RUNNER #error "This test requires to be run under device-os-test" @@ -26,6 +27,10 @@ #define TEST_ELECTRON_USE_HSE_LSI (1) #endif // TEST_ELECTRON_USE_HSE_LSI +#ifndef TEST_ELECTRON_VALIDATE_USES_HSE_LSI +#define TEST_ELECTRON_VALIDATE_USES_HSE_LSI (0) +#endif // TEST_ELECTRON_VALIDATE_USES_HSE_LSI + namespace { retained time_t sRtcTime = 0; @@ -38,7 +43,9 @@ test(01_connect_set_feature_reset) { System.enableFeature(FEATURE_DISABLE_EXTERNAL_LOW_SPEED_CLOCK); assertTrue(System.featureEnabled(FEATURE_DISABLE_EXTERNAL_LOW_SPEED_CLOCK)); } else { - assertEqual((RCC->BDCR & 0x300), (RCC_RTCCLKSource_HSE_Div2 & 0x300)); + if (TEST_ELECTRON_VALIDATE_USES_HSE_LSI) { + assertEqual((RCC->BDCR & 0x300), (RCC_RTCCLKSource_HSE_Div2 & 0x300)); + } System.disableFeature(FEATURE_DISABLE_EXTERNAL_LOW_SPEED_CLOCK); assertFalse(System.featureEnabled(FEATURE_DISABLE_EXTERNAL_LOW_SPEED_CLOCK)); } diff --git a/user/tests/wiring/electron_rtc_clock_source/test_config_hse_lsi.h b/user/tests/wiring/electron_rtc_clock_source/test_config_hse_lsi.h new file mode 100644 index 0000000000..0c8500a48c --- /dev/null +++ b/user/tests/wiring/electron_rtc_clock_source/test_config_hse_lsi.h @@ -0,0 +1,3 @@ +#pragma once + +#define TEST_ELECTRON_USE_HSE_LSI (1) diff --git a/user/tests/wiring/electron_rtc_clock_source/test_config_lse.h b/user/tests/wiring/electron_rtc_clock_source/test_config_lse.h new file mode 100644 index 0000000000..6c0c2d189a --- /dev/null +++ b/user/tests/wiring/electron_rtc_clock_source/test_config_lse.h @@ -0,0 +1,3 @@ +#pragma once + +#define TEST_ELECTRON_USE_HSE_LSI (0) diff --git a/user/tests/wiring/electron_rtc_clock_source/test_config_lse_validate.h b/user/tests/wiring/electron_rtc_clock_source/test_config_lse_validate.h new file mode 100644 index 0000000000..718fe2c9c9 --- /dev/null +++ b/user/tests/wiring/electron_rtc_clock_source/test_config_lse_validate.h @@ -0,0 +1,4 @@ +#pragma once + +#define TEST_ELECTRON_USE_HSE_LSI (0) +#define TEST_ELECTRON_VALIDATE_USES_HSE_LSI (1) diff --git a/user/tests/wiring/electron_enable_external_rtc_clock/zzz_electron_enable_external_rtc_clock.spec.js b/user/tests/wiring/electron_rtc_clock_source/zzz_electron_enable_external_rtc_clock.spec.js similarity index 100% rename from user/tests/wiring/electron_enable_external_rtc_clock/zzz_electron_enable_external_rtc_clock.spec.js rename to user/tests/wiring/electron_rtc_clock_source/zzz_electron_enable_external_rtc_clock.spec.js