mirror of https://github.com/ARMmbed/mbed-os.git
Refactored EEPROM and InterruptIn test cases to do auto-detection act
Refactoring Tested with few Nucleo boards and Nordic boardpull/900/head
parent
b877fe32f9
commit
ab472195ce
|
@ -70,8 +70,12 @@ const int i2c_freq_hz = 400000;
|
||||||
const int i2c_delay_us = 0;
|
const int i2c_delay_us = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main()
|
int main() {
|
||||||
{
|
TEST_TIMEOUT(15);
|
||||||
|
TEST_HOSTTEST(default_auto);
|
||||||
|
TEST_DESCRIPTION(I2C EEPROM read write test);
|
||||||
|
TEST_START("MBED_A19");
|
||||||
|
|
||||||
const int EEPROM_MEM_ADDR = 0xA0;
|
const int EEPROM_MEM_ADDR = 0xA0;
|
||||||
const char MARK = 0x66;
|
const char MARK = 0x66;
|
||||||
int fw = 0;
|
int fw = 0;
|
||||||
|
@ -143,5 +147,5 @@ int main()
|
||||||
printf("\tTotal failures: %d\r\n", fw + fr + fc);
|
printf("\tTotal failures: %d\r\n", fw + fr + fc);
|
||||||
}
|
}
|
||||||
|
|
||||||
notify_completion(result);
|
TEST_RESULT(result);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,13 +22,13 @@
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
// Test configuration block
|
// Test configuration block
|
||||||
namespace
|
namespace {
|
||||||
{
|
|
||||||
const int ntests = 1000;
|
const int ntests = 1000;
|
||||||
const int i2c_freq_hz = 400000;
|
const int i2c_freq_hz = 400000;
|
||||||
const int i2c_delay_us = 0;
|
const int i2c_delay_us = 0;
|
||||||
// const int EEPROM_24LC256_SIZE = (256 * 1024 / 8); // 256 kbit memory
|
// const int EEPROM_24LC256_SIZE = (256 * 1024 / 8); // 256 kbit memory
|
||||||
}
|
}
|
||||||
|
|
||||||
// End of test configuration block
|
// End of test configuration block
|
||||||
|
|
||||||
#if defined(TARGET_KL25Z)
|
#if defined(TARGET_KL25Z)
|
||||||
|
@ -75,8 +75,12 @@ I2C i2c(p28, p27);
|
||||||
|
|
||||||
#define PATTERN_MASK 0x66, ~0x66, 0x00, 0xFF, 0xA5, 0x5A, 0xF0, 0x0F
|
#define PATTERN_MASK 0x66, ~0x66, 0x00, 0xFF, 0xA5, 0x5A, 0xF0, 0x0F
|
||||||
|
|
||||||
int main()
|
int main() {
|
||||||
{
|
TEST_TIMEOUT(15);
|
||||||
|
TEST_HOSTTEST(default_auto);
|
||||||
|
TEST_DESCRIPTION(I2C EEPROM line read write test);
|
||||||
|
TEST_START("MBED_A25");
|
||||||
|
|
||||||
const int EEPROM_MEM_ADDR = 0xA0;
|
const int EEPROM_MEM_ADDR = 0xA0;
|
||||||
bool result = true;
|
bool result = true;
|
||||||
|
|
||||||
|
@ -134,5 +138,5 @@ int main()
|
||||||
printf("EEPROM: Pattern match errors: %d/%d ... [%s]\r\n", pattern_errors, ntests, pattern_errors ? "FAIL" : "OK");
|
printf("EEPROM: Pattern match errors: %d/%d ... [%s]\r\n", pattern_errors, ntests, pattern_errors ? "FAIL" : "OK");
|
||||||
|
|
||||||
result = write_errors == 0 && read_errors == 0;
|
result = write_errors == 0 && read_errors == 0;
|
||||||
notify_completion(result);
|
TEST_RESULT(result);
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,7 +87,7 @@ void flipper() {
|
||||||
}
|
}
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
TEST_TIMEOUT(20);
|
TEST_TIMEOUT(15);
|
||||||
TEST_HOSTTEST(default_auto);
|
TEST_HOSTTEST(default_auto);
|
||||||
TEST_DESCRIPTION(InterruptIn);
|
TEST_DESCRIPTION(InterruptIn);
|
||||||
TEST_START("MBED_A7");
|
TEST_START("MBED_A7");
|
||||||
|
|
|
@ -119,6 +119,7 @@ TESTS = [
|
||||||
"id": "MBED_A7", "description": "InterruptIn",
|
"id": "MBED_A7", "description": "InterruptIn",
|
||||||
"source_dir": join(TEST_DIR, "mbed", "interruptin"),
|
"source_dir": join(TEST_DIR, "mbed", "interruptin"),
|
||||||
"dependencies": [MBED_LIBRARIES, TEST_MBED_LIB],
|
"dependencies": [MBED_LIBRARIES, TEST_MBED_LIB],
|
||||||
|
"duration": 15,
|
||||||
"automated": True,
|
"automated": True,
|
||||||
"peripherals": ["digital_loop"]
|
"peripherals": ["digital_loop"]
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue