Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds fixture tests #2823

Merged
merged 26 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2e0c3b2
[tests] add wiring/i2c_master_slave fixture test
technobly Aug 13, 2024
9cc9763
[tests] add wiring/i2c_master_slave config files
technobly Aug 13, 2024
200bb8b
[tests] add wiring/i2c_mcp23017 fixture test
technobly Aug 13, 2024
550d68f
[tests] add wiring/i2c_mcp23017 config files
technobly Aug 13, 2024
d8b1857
[tests] add wiring/spi_master_slave fixture test
technobly Aug 13, 2024
2784846
[tests] add wiring/spi_master_slave config files
technobly Aug 13, 2024
3e54a5a
[tests] spec changes to target compiling for argon/p2 only
technobly Aug 16, 2024
10790a8
[tests] add wiring/sleep20 fixture test
technobly Aug 16, 2024
7216c4d
[tests] add wiring/sleep20 config file
technobly Aug 16, 2024
db009b2
[tests] add config files
technobly Aug 20, 2024
5e3fcbd
[tests] fixes wiring/spi_master_slave fixture test
technobly Aug 21, 2024
cf1db67
[tests] update wiring/spi_master_slave config files
technobly Aug 21, 2024
44d9234
[tests] fixes build for p2
technobly Aug 22, 2024
a457036
[tests] fixes wiring/i2c_mcp23017 tests
technobly Aug 22, 2024
f138ad4
[tests] allow wiring/no_fixture to be run manually, cleanup config files
technobly Aug 29, 2024
c2ca692
[tests] updates to wiring/i2c_master_slave
technobly Sep 1, 2024
4ad1781
[tests] updates to wiring/serial_loopback & wiring/serial_loopback2
technobly Sep 1, 2024
7404451
[tests] updates to wiring/spi_master_slave
technobly Sep 1, 2024
19bda63
[tests] updates to wiring/sleep20
technobly Sep 1, 2024
da87bb9
[tests] updates to wiring/ble_central_peripheral and wiring/ble_scann…
technobly Sep 1, 2024
50b657d
[tests] updates to spec.js files
technobly Sep 4, 2024
98edb5e
[tests] platform changes and wiring/sleep20 ADC pin moved to A1
technobly Sep 4, 2024
7bac0af
[tests] fix build for tracker
technobly Sep 5, 2024
acd35d9
[tests] add missing spec.js
technobly Sep 5, 2024
66435d5
[tests] update to wiring/spi_master_slave
technobly Sep 5, 2024
947a6e4
minor
avtolstoy Sep 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions user/tests/integration/wiring/i2c_master_slave
1 change: 1 addition & 0 deletions user/tests/integration/wiring/i2c_mcp23017
1 change: 1 addition & 0 deletions user/tests/integration/wiring/sleep20
1 change: 1 addition & 0 deletions user/tests/integration/wiring/spi_master_slave
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,16 @@ void onDisconnectRequested(const char *eventName, const char *data) {
disconnect = true;
}

test(BLE_0000_Check_Feature_Disable_Listening_Mode) {
if (System.featureEnabled(FEATURE_DISABLE_LISTENING_MODE)) {
System.disableFeature(FEATURE_DISABLE_LISTENING_MODE);
assertEqual(0, pushMailbox(MailboxEntry().type(MailboxEntry::Type::RESET_PENDING), 5000));
System.reset();
}
}

test(BLE_000_Central_Cloud_Connect) {
assertFalse(System.featureEnabled(FEATURE_DISABLE_LISTENING_MODE));
subscribeEvents(BLE_ROLE_PERIPHERAL);
Particle.subscribe("BLE disconnect", onDisconnectRequested);
Particle.connect();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
suite('BLE central peripheral');
platform('gen3', 'gen4');
platform('gen3', 'p2');
fixture('ble_central', 'ble_peripheral');
systemThread('enabled');
// This tag should be filtered out by default
Expand Down Expand Up @@ -37,6 +37,9 @@ async function distributePeerInfo() {
}
}

test('BLE_0000_Check_Feature_Disable_Listening_Mode', async function () {
});

test('BLE_000_Peripheral_Cloud_Connect', async function() {
console.log(`Waiting for peer info from Peripheral device ${peripheralDevice.id}`);
const data = await this.particle.receiveEvent(BASE_EVENT_NAME + peripheralDevice.id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,17 @@ constexpr uint16_t PEER_DESIRED_ATT_MTU = 100;
Thread* scanThread = nullptr;
volatile unsigned scanResults = 0;

test(BLE_0000_Check_Feature_Disable_Listening_Mode) {
// System.enableFeature(FEATURE_DISABLE_LISTENING_MODE);
if (System.featureEnabled(FEATURE_DISABLE_LISTENING_MODE)) {
System.disableFeature(FEATURE_DISABLE_LISTENING_MODE);
assertEqual(0, pushMailbox(MailboxEntry().type(MailboxEntry::Type::RESET_PENDING), 5000));
System.reset();
}
}

test(BLE_000_Peripheral_Cloud_Connect) {
assertFalse(System.featureEnabled(FEATURE_DISABLE_LISTENING_MODE));
subscribeEvents(BLE_ROLE_PERIPHERAL);
Particle.connect();
assertTrue(waitFor(Particle.connected, HAL_PLATFORM_MAX_CLOUD_CONNECT_TIME));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,16 @@ void onDataReceived(const uint8_t* data, size_t len, const BlePeerDevice& peer,

using namespace particle::test;

test(BLE_000_Broacaster_Cloud_Connect) {
test(BLE_0000_Check_Feature_Disable_Listening_Mode) {
if (System.featureEnabled(FEATURE_DISABLE_LISTENING_MODE)) {
System.disableFeature(FEATURE_DISABLE_LISTENING_MODE);
assertEqual(0, pushMailbox(MailboxEntry().type(MailboxEntry::Type::RESET_PENDING), 5000));
System.reset();
}
}

test(BLE_000_Broadcaster_Cloud_Connect) {
assertFalse(System.featureEnabled(FEATURE_DISABLE_LISTENING_MODE));
subscribeEvents(BLE_ROLE_PERIPHERAL);
Particle.connect();
assertTrue(waitFor(Particle.connected, HAL_PLATFORM_MAX_CLOUD_CONNECT_TIME));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,16 @@ BleCharacteristic peerCharWriteWoRsp;

using namespace particle::test;

test(BLE_0000_Check_Feature_Disable_Listening_Mode) {
if (System.featureEnabled(FEATURE_DISABLE_LISTENING_MODE)) {
System.disableFeature(FEATURE_DISABLE_LISTENING_MODE);
assertEqual(0, pushMailbox(MailboxEntry().type(MailboxEntry::Type::RESET_PENDING), 5000));
System.reset();
}
}

test(BLE_000_Scanner_Cloud_Connect) {
assertFalse(System.featureEnabled(FEATURE_DISABLE_LISTENING_MODE));
subscribeEvents(BLE_ROLE_PERIPHERAL);
Particle.connect();
assertTrue(waitFor(Particle.connected, HAL_PLATFORM_MAX_CLOUD_CONNECT_TIME));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
suite('BLE scanner broadcaster');
platform('gen3', 'gen4');
platform('gen3', 'p2');
fixture('ble_scanner', 'ble_broadcaster');
systemThread('enabled');
// This tag should be filtered out by default
Expand Down Expand Up @@ -37,7 +37,10 @@ async function distributePeerInfo() {
}
}

test('BLE_000_Broacaster_Cloud_Connect', async function() {
test('BLE_0000_Check_Feature_Disable_Listening_Mode', async function () {
});

test('BLE_000_Broadcaster_Cloud_Connect', async function() {
console.log(`Waiting for peer info from Broadcaster (Peripheral) device ${peripheralDevice.id}`);
const data = await this.particle.receiveEvent(BASE_EVENT_NAME + peripheralDevice.id);
console.log(data);
Expand Down
4 changes: 4 additions & 0 deletions user/tests/wiring/i2c_master_slave/i2c_master/application.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#ifndef PARTICLE_TEST_RUNNER

#include "application.h"
#include "unit-test/unit-test.h"

SYSTEM_MODE(SEMI_AUTOMATIC);

UNIT_TEST_APP();

#endif // PARTICLE_TEST_RUNNER
Loading