Merge pull request #31 from 0xc0170/rtos_tests

Rtos tests
Bogdan Marinescu 2016-04-11 12:11:13 +03:00
commit 6656fbf9e1
8 changed files with 14 additions and 39 deletions

View File

@ -34,10 +34,7 @@ void led2_thread(void const *argument) {
}
int main() {
MBED_HOSTTEST_TIMEOUT(15);
MBED_HOSTTEST_SELECT(wait_us_auto);
MBED_HOSTTEST_DESCRIPTION(Basic thread);
MBED_HOSTTEST_START("RTOS_1");
GREENTEA_SETUP(15, "wait_us_auto");
Thread thread(led2_thread, NULL, osPriorityNormal, STACK_SIZE);

View File

@ -38,10 +38,7 @@ void queue_thread(void const *argument) {
}
int main (void) {
MBED_HOSTTEST_TIMEOUT(20);
MBED_HOSTTEST_SELECT(default_auto);
MBED_HOSTTEST_DESCRIPTION(ISR (Queue));
MBED_HOSTTEST_START("RTOS_8");
GREENTEA_SETUP(20, "default_auto");
Thread thread(queue_thread, NULL, osPriorityNormal, STACK_SIZE);
Ticker ticker;
@ -66,6 +63,6 @@ int main (void) {
}
}
MBED_HOSTTEST_RESULT(result);
GREENTEA_TESTSUITE_RESULT(result);
return 0;
}

View File

@ -44,10 +44,7 @@ void send_thread (void const *argument) {
}
int main (void) {
MBED_HOSTTEST_TIMEOUT(20);
MBED_HOSTTEST_SELECT(default_auto);
MBED_HOSTTEST_DESCRIPTION(Mail messaging);
MBED_HOSTTEST_START("RTOS_6");
GREENTEA_SETUP(20, "default_auto");
Thread thread(send_thread, NULL, osPriorityNormal, STACK_SIZE);
bool result = true;
@ -74,6 +71,6 @@ int main (void) {
}
}
}
MBED_HOSTTEST_RESULT(result);
GREENTEA_TESTSUITE_RESULT(result);
return 0;
}

View File

@ -73,11 +73,7 @@ void test_thread(void const *args) {
}
int main() {
MBED_HOSTTEST_TIMEOUT(20);
MBED_HOSTTEST_SELECT(default);
MBED_HOSTTEST_DESCRIPTION(Mutex resource lock);
MBED_HOSTTEST_START("RTOS_2");
GREENTEA_SETUP(20, "default_auto");
const int t1_delay = THREAD_DELAY * 1;
const int t2_delay = THREAD_DELAY * 2;
const int t3_delay = THREAD_DELAY * 3;
@ -96,6 +92,6 @@ int main() {
}
fflush(stdout);
MBED_HOSTTEST_RESULT(!mutex_defect);
GREENTEA_TESTSUITE_RESULT(!mutex_defect);
return 0;
}

View File

@ -46,10 +46,7 @@ void send_thread (void const *argument) {
}
int main (void) {
MBED_HOSTTEST_TIMEOUT(20);
MBED_HOSTTEST_SELECT(default_auto);
MBED_HOSTTEST_DESCRIPTION(Queue messaging);
MBED_HOSTTEST_START("RTOS_5");
GREENTEA_SETUP(20, "default_auto");
Thread thread(send_thread, NULL, osPriorityNormal, STACK_SIZE);
bool result = true;
@ -76,6 +73,6 @@ int main (void) {
}
}
}
MBED_HOSTTEST_RESULT(result);
GREENTEA_TESTSUITE_RESULT(result);
return 0;
}

View File

@ -64,10 +64,7 @@ void test_thread(void const *delay) {
}
int main (void) {
MBED_HOSTTEST_TIMEOUT(20);
MBED_HOSTTEST_SELECT(default_auto);
MBED_HOSTTEST_DESCRIPTION(Semaphore resource lock);
MBED_HOSTTEST_START("RTOS_3");
GREENTEA_SETUP(20, "default_auto");
const int t1_delay = THREAD_DELAY * 1;
const int t2_delay = THREAD_DELAY * 2;
@ -86,6 +83,6 @@ int main (void) {
}
fflush(stdout);
MBED_HOSTTEST_RESULT(!sem_defect);
GREENTEA_TESTSUITE_RESULT(!sem_defect);
return 0;
}

View File

@ -32,10 +32,7 @@ void led_thread(void const *argument) {
}
int main (void) {
MBED_HOSTTEST_TIMEOUT(20);
MBED_HOSTTEST_SELECT(default_auto);
MBED_HOSTTEST_DESCRIPTION(Signals messaging);
MBED_HOSTTEST_START("RTOS_4");
GREENTEA_SETUP(20, "default_auto");
Thread thread(led_thread, NULL, osPriorityNormal, STACK_SIZE);
bool result = true;
@ -48,6 +45,6 @@ int main (void) {
break;
}
}
MBED_HOSTTEST_RESULT(result);
GREENTEA_TESTSUITE_RESULT(result);
return 0;
}

View File

@ -23,10 +23,7 @@ void blink(void const *n) {
}
int main(void) {
MBED_HOSTTEST_TIMEOUT(15);
MBED_HOSTTEST_SELECT(wait_us_auto);
MBED_HOSTTEST_DESCRIPTION(Timer);
MBED_HOSTTEST_START("RTOS_7");
GREENTEA_SETUP(15, "wait_us_auto");
RtosTimer led_1_timer(blink, osTimerPeriodic, (void *)0);
RtosTimer led_2_timer(blink, osTimerPeriodic, (void *)1);