Skip to content

Commit

Permalink
Merge pull request #9 from 0xc0170/fix_wording
Browse files Browse the repository at this point in the history
Wording fixes in the comments and README
  • Loading branch information
BlackstoneEngineering committed Nov 14, 2016
2 parents ec0304c + d0e1552 commit 53d4476
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ If you platform does not support a specific feature, such as AnalogOut, then tha
The CI Test Shield has several uses.

1. Test mbed-os software port. Useful for mbed partners and community contributors.
2. Continuous Integration testing during development and during maintinance release cycles.
2. Continuous Integration testing during development and during maintenance release cycles.
3. SD Card storage can be used for firmware update development.

## What is tested?
Expand Down Expand Up @@ -66,7 +66,7 @@ For example: the NXP K64F board does not have AnalogOut on A5, instead it is on
The above code essentially says "if the target is `K64F` then `#define AOUT DAC0_OUT`", this allows you to fly wire pins and only modify things in one file instead of having to modify all the tests themselves.

#### Non-Arduino Header
If you are testing a board that does not have Arduino R3 style headers then you will need to either fly wire all the pins across manually, or if you want a more permenant solution spin your own version of the CI Test shield with headers that map to your board.
If you are testing a board that does not have Arduino R3 style headers then you will need to either fly wire all the pins across manually, or if you want a more permanent solution spin your own version of the CI Test shield with headers that map to your board.

Either way, you will need to heavily modify the `mbed_app.json` file and redefine every pin mapping since your platform will not have the Arduino Header D0-15 or A0-5 pin aliases.

Expand All @@ -76,7 +76,7 @@ For more on how config files work see the [mbed OS docs](https://github.com/ARMm
- Use the `-v` flag for verbose debug and failure messages that can help you troubleshoot.
- Try running a clean build with `mbed test --clean -n tests-* --app-config .\mbed_app.json -v`
- Make sure your board is detected to run tests. Use the `mbed detect` command to verify your board is recognized and has a COM port assigned. If the Serial driver isn't working then tests cant run.
- make sure you are using the latest version of greentea and mbed cli. Try running `pip install -U mbed-cli mbed-ls mbed-greentea` to update them all to their latest versions.
- make sure you are using the latest version of greentea and mbed-cli. Try running `pip install -U mbed-cli mbed-ls mbed-greentea` to update them all to their latest versions.
- Tests in the `assumptions` folder should all pass, if any of the assumptions tests fail then their associated test will likely also fail. For example, AnalogIn pins should also be DigitalOut capable for the AnalogIn tests to work, so the assumptions test for AnalogIn tests this functionality.
- If all tests are failing try bending aside pins D0/D1 on the CI Test Shield. Some platforms only have 1 Serial peripheral and will tie together the debug serial channel and the loopback serial channel, which causes problems for the communications for the testing platform.
- Make sure to put an SD Card into the microSD slot for SPI Tests to work.
Expand Down
2 changes: 1 addition & 1 deletion TESTS/API/AnalogIn/AnalogIn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void AnalogInput_Test()
prev_value = ain.read();
y = (y<<1) + 1;
outputs = y;
TEST_ASSERT_MESSAGE(ain.read() > prev_value,"Analog Input did not incriment. Check that you have assigned valid pins in mbed_app.json file")
TEST_ASSERT_MESSAGE(ain.read() > prev_value,"Analog Input did not increment. Check that you have assigned valid pins in mbed_app.json file")
}
// printf("Finished the Test\n");
TEST_ASSERT(true);
Expand Down
2 changes: 1 addition & 1 deletion TESTS/API/AnalogOut/AnalogOut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ utest::v1::status_t test_setup(const size_t number_of_cases) {
return verbose_test_setup_handler(number_of_cases);
}

// Handle test failures, keep testing, dont stop
// Handle test failures, keep testing, don't stop
utest::v1::status_t greentea_failure_handler(const Case *const source, const failure_t reason) {
greentea_case_failure_abort_handler(source, reason);
return STATUS_CONTINUE;
Expand Down
2 changes: 1 addition & 1 deletion TESTS/API/BusInOut/BusInOut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ utest::v1::status_t test_setup(const size_t number_of_cases) {
return verbose_test_setup_handler(number_of_cases);
}

// Handle test failures, keep testing, dont stop
// Handle test failures, keep testing, don't stop
utest::v1::status_t greentea_failure_handler(const Case *const source, const failure_t reason) {
greentea_case_failure_abort_handler(source, reason);
return STATUS_CONTINUE;
Expand Down
4 changes: 2 additions & 2 deletions TESTS/API/InterruptIn/InterruptIn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void cbfn(void){
//printf("\t**** Interrupt Triggered!\n");
}

// Template to check Falling edge and Risign edge interrupts.
// Template to check Falling edge and Rising edge interrupts.
template <PinName int_pin, PinName dout_pin>
void InterruptInTest()
{
Expand Down Expand Up @@ -79,4 +79,4 @@ Specification specification(test_setup, cases);
// Entry point into the tests
int main() {
return !Harness::run(specification);
}
}
8 changes: 4 additions & 4 deletions TESTS/API/Pwm/Pwm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void duty_cbfn_fall(void){
}

// Template to test the Duty cycle API on PWM Pins. This test will collect a sample size of tests and average out the length of the duty cycle
// the averaged duty cycle is then compared against the expectd duty cycle.
// the averaged duty cycle is then compared against the expected duty cycle.
void PWM_Duty_slave(PinName pwm_out_pin, PinName int_in_pin, int period_in_ms, float duty_cycle_percent)
{
#define NUM_TESTS 30
Expand Down Expand Up @@ -70,7 +70,7 @@ void PWM_Duty_slave(PinName pwm_out_pin, PinName int_in_pin, int period_in_ms, f
//TEST_ASSERT_MESSAGE( std::abs(expectedTime - avgTime) <= one_percent, "Greater than 1 percent variance between expected and measured duty cycle");
}

// Template to itterate through a PWM pin, takes in period and tries 10%-100% duty cycle in intervals of 10%
// Template to iterate through a PWM pin, takes in period and tries 10%-100% duty cycle in intervals of 10%
template <PinName pwm_out_pin, PinName int_in_pin, int period_in_miliseconds>
void PWM_DutyCycle_Test()
{
Expand All @@ -79,7 +79,7 @@ void PWM_DutyCycle_Test()
#define MAX_DUTY_CYCLE 0.9f

float x = 0;
for(x = MIN_DUTY_CYCLE; x < MAX_DUTY_CYCLE; x = x+DUTY_CYCLE_STEP){ // itterate duty cycle test
for(x = MIN_DUTY_CYCLE; x < MAX_DUTY_CYCLE; x = x+DUTY_CYCLE_STEP){ // iterate duty cycle test
PWM_Duty_slave(pwm_out_pin, int_in_pin, period_in_miliseconds, x);
//printf("\r\n**************\r\n expected 10 cycles, saw %d rise, %d fall\r\n*******\r\n",duty_rise_count,duty_fall_count);
//TEST_ASSERT_MESSAGE(100 == rise_count,"Number of cycles not equivalent to amount expected\r\n");
Expand Down Expand Up @@ -183,7 +183,7 @@ utest::v1::status_t greentea_failure_handler(const Case *const source, const fai
// TODO: take pin names from config file or generate from pinmap file
Case cases[] = {
// Test Creat PwmOut Objects
Case("Pwm object definable", pwm_define_test,greentea_failure_handler), // test pwm object contructor works
Case("Pwm object definable", pwm_define_test,greentea_failure_handler), // test pwm object constructor works

// Test Frequency length by counting rise / fall ticks
Case("PWM_0 Frequency 10ms", PWM_Period_Test< MBED_CONF_APP_PWM_0, MBED_CONF_APP_DIO_2, 10, 1000 >, greentea_failure_handler), // Test at 10ms 100 times, default 50%duty cycle
Expand Down
4 changes: 2 additions & 2 deletions TESTS/API/SPI/SPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void init_string(){
printf("\r\n****\r\nSD Test String = %s\r\n****\r\n",SD_TEST_STRING);
}

// Test object contructor / destructor
// Test object constructor / destructor
void test_object(){
SPI(MBED_CONF_APP_SPI_MOSI, MBED_CONF_APP_SPI_MISO, MBED_CONF_APP_SPI_CLK, MBED_CONF_APP_SPI_CS);
TEST_ASSERT_MESSAGE(true,"If the tests hangs here then there is a problem with the SPI Object"); // helpful debug message for if the test hangs
Expand Down Expand Up @@ -93,4 +93,4 @@ utest::v1::status_t greentea_failure_handler(const Case *const source, const fai
int main() {
init_string();
return !Harness::run(specification);
}
}
6 changes: 3 additions & 3 deletions TESTS/assumptions/AnalogIn/AnalogIn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@

using namespace utest::v1;

// test for existance of DEVICE_ANALOGIN macro. If it doesnt exist then the device doesnt support the AnalogIn API
// test for existence of DEVICE_ANALOGIN macro. If it doesn't exist then the device doesn't support the AnalogIn API
void Macro_Test(){
#ifndef DEVICE_ANALOGIN
TEST_ASSERT_MESSAGE(false,"Macr `DEVICE_ANALOGIN` not defined. This platform does not support AnalogIn.")
#endif
}

// Test if the AnalogInput can also do DigitalIO. Falure expects a timeout.
// Test if the AnalogInput can also do DigitalIO. Failure expects a timeout.
// typical failure is a run time assert deep in mbed library.
// CI Test shield assumes AnalogIn pins can double duty as DigitalOut pins.
template <PinName ain_pin>
Expand All @@ -44,7 +44,7 @@ utest::v1::status_t test_setup(const size_t number_of_cases) {
return verbose_test_setup_handler(number_of_cases);
}

// Handle test failures, keep testing, dont stop
// Handle test failures, keep testing, don't stop
utest::v1::status_t greentea_failure_handler(const Case *const source, const failure_t reason) {
greentea_case_failure_abort_handler(source, reason);
return STATUS_CONTINUE;
Expand Down

0 comments on commit 53d4476

Please sign in to comment.