Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
23db630
Initial setup of mbed level testing
mray190 Feb 16, 2017
9c786c8
Working version of dynamic pin testing for L0
mray190 Feb 21, 2017
80d2c56
Working state machine for L1/L2 tests
mray190 Feb 23, 2017
ca78d45
Failing analog out
mray190 Feb 23, 2017
567634c
Working L0-L2 for AnalogIn/Out - intended as the starting framework
mray190 Feb 24, 2017
3d4b143
DigitalIO framework setup
mray190 Feb 24, 2017
9be016f
Added PWM and DigitalIO tests
mray190 Mar 1, 2017
dac97ca
Added I2C and SPI base tests
mray190 Mar 2, 2017
e49460f
Finished Level0 tests
mray190 Mar 10, 2017
a135774
Added arduino tests
mray190 Mar 14, 2017
401ea3f
Additional Level1 and Level2 tests added
mray190 Mar 21, 2017
e98b4c8
Merged master into level-testing branch for I2C and SPI changes
mray190 Mar 21, 2017
64e3bdc
Halfway through porting over to final version
mray190 Mar 22, 2017
786ad08
Final commit for up to level 2
mray190 Mar 22, 2017
6f6a274
Finished Level 3 tests
mray190 Mar 27, 2017
62b43d9
Made changes outlined in pull request #47
mray190 Apr 5, 2017
8e1904d
Update mbed_app.json
mray190 Apr 5, 2017
6b956e6
Formated code so that it is uniform between all the tests. Removed un…
Jun 28, 2017
4846b7b
Removed unused ANSI_COLOR_<COLOR NAME> defs from TestFramework.hpp
Jun 29, 2017
d093ddc
Changed BusInOut so that it creates a bus of 16 pins instead of 15. S…
Jun 29, 2017
d15893d
Changed tag from unnecessary int to a bool instead. Updated some comm…
Jun 29, 2017
df47ace
Fixed some bugs in TestFramework::run_spi. SPI_CS was not switching …
Jun 30, 2017
c9f75d4
Added greater coverage for level0/SPI testing. It now tests all poss…
Jul 3, 2017
0015759
Merge pull request #1 from brandonboesch/level-testing
mray190 Jul 5, 2017
169500e
Cleaned up SPI code in TestFramework to make it easier to read and fo…
Jul 6, 2017
c7ca382
Added K22F to mbed_app.json. Formated Level1/AnalogIn. Added USBTX &&…
Jul 6, 2017
f3c379a
Added check to prevent pins already assigned to USBTX && USBRX from g…
Jul 7, 2017
285d385
Modified TestFramework::map_pins so that it no longer adds pins if th…
Jul 7, 2017
3053b8d
Condensed code in TestFramework for level1 testing
Jul 11, 2017
9919bb1
Removed wait() from Level0-spi test, and changed timeout value. Added…
Jul 12, 2017
cdf9af1
Merge pull request #2 from brandonboesch/level-testing
mray190 Jul 13, 2017
974b776
Merge branch 'master' into level-testing
mray190 Jul 13, 2017
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
Empty file modified I2CEeprom.lib
100755 → 100644
Empty file.
1 change: 0 additions & 1 deletion LM75B.lib

This file was deleted.

2 changes: 1 addition & 1 deletion TESTS/API/BusInOut/BusInOut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void businout_bidirectional_test(){
BusOut bout(MBED_CONF_APP_DIO_3,MBED_CONF_APP_DIO_5,MBED_CONF_APP_DIO_7,MBED_CONF_APP_DIO_9);
bout = 0;
volatile int x = 0;
while(x < 0x0F){
while(x < 0x0F) {
x++;
bout.write(x);
DEBUG_PRINTF("\r\n*********\r\nvalue of bin,bout,x is: 0x%x, 0x%x, 0x%x\r\n********\r\n",bin.read(),bout.read(),x);
Expand Down
59 changes: 59 additions & 0 deletions TESTS/Arduino/AnalogIn/AnalogIn.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Copyright (c) 2016 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if !DEVICE_ANALOGIN
#error [NOT_SUPPORTED] AnalogIn not supported on this platform, add 'DEVICE_ANALOGIN' definition to your platform.
#endif

#include "mbed.h"
#include "greentea-client/test_env.h"
#include "unity.h"
#include "utest.h"
#include "ci_test_config.h"

using namespace utest::v1;

// Template to set one Analog pin as input and then cycle through the rest as outputs.
// As you turn more pins on the voltage on the ain pin will go up.
template <PinName ain_pin>
void AnalogInput_Test(){
AnalogIn ain(ain_pin);
DEBUG_PRINTF("Tested pin %d for Arduino analog in capabilities\n", ain_pin);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Global comment: from my side, I would prefer a debug printf as %#x instead of %d for pin number

}

utest::v1::status_t test_setup(const size_t number_of_cases) {
GREENTEA_SETUP(30, "default_auto");
return verbose_test_setup_handler(number_of_cases);
}

utest::v1::status_t greentea_failure_handler(const Case *const source, const failure_t reason) {
greentea_case_failure_abort_handler(source, reason);
return STATUS_ABORT;
}

Case cases[] = {
Case("Arduino - Analog Input Constructor on AIN_0", AnalogInput_Test<MBED_CONF_APP_AIN_0>, greentea_failure_handler),
Case("Arduino - Analog Input Constructor on AIN_1", AnalogInput_Test<MBED_CONF_APP_AIN_1>, greentea_failure_handler),
Case("Arduino - Analog Input Constructor on AIN_2", AnalogInput_Test<MBED_CONF_APP_AIN_2>, greentea_failure_handler),
Case("Arduino - Analog Input Constructor on AIN_3", AnalogInput_Test<MBED_CONF_APP_AIN_3>, greentea_failure_handler),
Case("Arduino - Analog Input Constructor on AIN_4", AnalogInput_Test<MBED_CONF_APP_AIN_4>, greentea_failure_handler),
Case("Arduino - Analog Input Constructor on AIN_5", AnalogInput_Test<MBED_CONF_APP_AIN_5>, greentea_failure_handler),
};

int main() {
// Formulate a specification and run the tests based on the Case array
Specification specification(test_setup, cases);
return !Harness::run(specification);
}
52 changes: 52 additions & 0 deletions TESTS/Arduino/AnalogOut/AnalogOut.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* Copyright (c) 2016 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if !DEVICE_ANALOGOUT
#error [NOT_SUPPORTED] AnalogOut not supported on this platform, add 'DEVICE_ANALOGOUT' definition to your platform.
#endif

#include "mbed.h"
#include "greentea-client/test_env.h"
#include "unity.h"
#include "utest.h"
#include "ci_test_config.h"

using namespace utest::v1;

template <PinName aout_pin>
void AnalogOutput_Test(){
AnalogOut ain(aout_pin);
DEBUG_PRINTF("Tested pin %d for Arduino analog out capabilities\n", aout_pin);
}

utest::v1::status_t test_setup(const size_t number_of_cases) {
GREENTEA_SETUP(30, "default_auto");
return verbose_test_setup_handler(number_of_cases);
}

utest::v1::status_t greentea_failure_handler(const Case *const source, const failure_t reason) {
greentea_case_failure_abort_handler(source, reason);
return STATUS_ABORT;
}

Case cases[] = {
Case("Arduino - Analog Output Constructor on AOUT_0", AnalogOutput_Test<MBED_CONF_APP_AOUT>, greentea_failure_handler),
};

int main() {
// Formulate a specification and run the tests based on the Case array
Specification specification(test_setup, cases);
return !Harness::run(specification);
}
59 changes: 59 additions & 0 deletions TESTS/Arduino/DigitalIO/DigitalIO.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Copyright (c) 2016 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "mbed.h"
#include "greentea-client/test_env.h"
#include "unity.h"
#include "utest.h"
#include "ci_test_config.h"

using namespace utest::v1;

template <PinName dio_pin>
void DigitalIO_Test(){
DigitalOut dout(dio_pin);
DigitalIn din(dio_pin);
DEBUG_PRINTF("Tested pin %d for Arduino digital in/out capabilities\n", dio_pin);
}

utest::v1::status_t test_setup(const size_t number_of_cases) {
GREENTEA_SETUP(30, "default_auto");
return verbose_test_setup_handler(number_of_cases);
}

utest::v1::status_t greentea_failure_handler(const Case *const source, const failure_t reason) {
greentea_case_failure_abort_handler(source, reason);
return STATUS_ABORT;
}

Case cases[] = {
Case("Arduino - Digital IO Constructor on DIO_0", DigitalIO_Test<MBED_CONF_APP_DIO_0>, greentea_failure_handler),
Case("Arduino - Digital IO Constructor on DIO_1", DigitalIO_Test<MBED_CONF_APP_DIO_1>, greentea_failure_handler),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure you want to test D0 and D1 as they are often used for printf ?

Case("Arduino - Digital IO Constructor on DIO_2", DigitalIO_Test<MBED_CONF_APP_DIO_2>, greentea_failure_handler),
Case("Arduino - Digital IO Constructor on DIO_3", DigitalIO_Test<MBED_CONF_APP_DIO_3>, greentea_failure_handler),
Case("Arduino - Digital IO Constructor on DIO_4", DigitalIO_Test<MBED_CONF_APP_DIO_4>, greentea_failure_handler),
Case("Arduino - Digital IO Constructor on DIO_5", DigitalIO_Test<MBED_CONF_APP_DIO_5>, greentea_failure_handler),
Case("Arduino - Digital IO Constructor on DIO_6", DigitalIO_Test<MBED_CONF_APP_DIO_6>, greentea_failure_handler),
Case("Arduino - Digital IO Constructor on DIO_7", DigitalIO_Test<MBED_CONF_APP_DIO_7>, greentea_failure_handler),
Case("Arduino - Digital IO Constructor on DIO_8", DigitalIO_Test<MBED_CONF_APP_DIO_8>, greentea_failure_handler),
Case("Arduino - Digital IO Constructor on DIO_9", DigitalIO_Test<MBED_CONF_APP_DIO_9>, greentea_failure_handler),
};

int main() {
// Formulate a specification and run the tests based on the Case array
Specification specification(test_setup, cases);
return !Harness::run(specification);
}
52 changes: 52 additions & 0 deletions TESTS/Arduino/I2C/I2C.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* Copyright (c) 2016 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if !DEVICE_I2C
#error [NOT_SUPPORTED] I2C not supported on this platform, add 'DEVICE_I2C' definition to your platform.
#endif

#include "mbed.h"
#include "greentea-client/test_env.h"
#include "unity.h"
#include "utest.h"
#include "ci_test_config.h"

using namespace utest::v1;

template <PinName sda, PinName scl>
void I2C_Test(){
I2C i2c(sda, scl);
DEBUG_PRINTF("Tested sda pin %d and scl pin %d for Arduino I2C capabilities\n", sda, scl);
}

utest::v1::status_t test_setup(const size_t number_of_cases) {
GREENTEA_SETUP(30, "default_auto");
return verbose_test_setup_handler(number_of_cases);
}

utest::v1::status_t greentea_failure_handler(const Case *const source, const failure_t reason) {
greentea_case_failure_abort_handler(source, reason);
return STATUS_ABORT;
}

Case cases[] = {
Case("Arduino - I2C Constructor on I2C_SDA/I2C_SCL", I2C_Test<MBED_CONF_APP_I2C_SDA, MBED_CONF_APP_I2C_SCL>, greentea_failure_handler),
};

int main() {
// Formulate a specification and run the tests based on the Case array
Specification specification(test_setup, cases);
return !Harness::run(specification);
}
55 changes: 55 additions & 0 deletions TESTS/Arduino/Pwm/Pwm.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Copyright (c) 2016 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if !DEVICE_PWMOUT
#error [NOT_SUPPORTED] PWMOUT not supported on this platform, add 'DEVICE_PWMOUT' definition to your platform.
#endif

#include "mbed.h"
#include "greentea-client/test_env.h"
#include "unity.h"
#include "utest.h"
#include "ci_test_config.h"

using namespace utest::v1;

template <PinName pwm_pin>
void PWM_Test(){
PwmOut pwm(pwm_pin);
DEBUG_PRINTF("Tested pin %d for Arduino digital in/out capabilities\n", pwm_pin);
}

utest::v1::status_t test_setup(const size_t number_of_cases) {
GREENTEA_SETUP(30, "default_auto");
return verbose_test_setup_handler(number_of_cases);
}

utest::v1::status_t greentea_failure_handler(const Case *const source, const failure_t reason) {
greentea_case_failure_abort_handler(source, reason);
return STATUS_ABORT;
}

Case cases[] = {
Case("Arduino - PWM Constructor on PWM_0", PWM_Test<MBED_CONF_APP_PWM_0>, greentea_failure_handler),
Case("Arduino - PWM Constructor on PWM_1", PWM_Test<MBED_CONF_APP_PWM_1>, greentea_failure_handler),
Case("Arduino - PWM Constructor on PWM_2", PWM_Test<MBED_CONF_APP_PWM_2>, greentea_failure_handler),
Case("Arduino - PWM Constructor on PWM_3", PWM_Test<MBED_CONF_APP_PWM_3>, greentea_failure_handler),
};

int main() {
// Formulate a specification and run the tests based on the Case array
Specification specification(test_setup, cases);
return !Harness::run(specification);
}
55 changes: 55 additions & 0 deletions TESTS/Arduino/SPI/SPI.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Copyright (c) 2016 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// check if SPI is supported on this device
#if !DEVICE_SPI
#error SPI is not supported on this platform, add 'DEVICE_SPI' definition to your platform.
#endif

#include "mbed.h"
#include "greentea-client/test_env.h"
#include "unity.h"
#include "utest.h"
#include "ci_test_config.h"

using namespace utest::v1;

template <PinName mosi_pin, PinName miso_pin, PinName clk_pin, PinName cs_pin>
void SPI_Test(){
SPI(mosi_pin, miso_pin, clk_pin);
DigitalOut cs(cs_pin);
DEBUG_PRINTF("Tested pins %d, %d, %d, and %d for Arduino SPI capabilities\n", mosi_pin, miso_pin, clk_pin, cs_pin);
}

utest::v1::status_t test_setup(const size_t number_of_cases) {
GREENTEA_SETUP(30, "default_auto");
return verbose_test_setup_handler(number_of_cases);
}

utest::v1::status_t greentea_failure_handler(const Case *const source, const failure_t reason) {
greentea_case_failure_abort_handler(source, reason);
return STATUS_ABORT;
}

Case cases[] = {
Case("Arduino - SPI Constructor", SPI_Test<MBED_CONF_APP_SPI_MOSI, MBED_CONF_APP_SPI_MISO, MBED_CONF_APP_SPI_CLK, MBED_CONF_APP_SPI_CS>, greentea_failure_handler),
};

int main() {
// Formulate a specification and run the tests based on the Case array
Specification specification(test_setup, cases);
return !Harness::run(specification);
}
Loading