From 1c872b164bb9e8fdd46d078207e54b57c888ad3d Mon Sep 17 00:00:00 2001 From: Austin Blackstone Date: Wed, 12 Oct 2016 14:28:19 +0100 Subject: [PATCH] Removing UART tests as they fail on >50% of boards, will add back when appropriate changes have been made to greentea / client test code --- TESTS/API/UART/UART.cpp | 66 ---------------------------------------- TESTS/host_tests/uart.py | 25 --------------- 2 files changed, 91 deletions(-) delete mode 100755 TESTS/API/UART/UART.cpp delete mode 100644 TESTS/host_tests/uart.py diff --git a/TESTS/API/UART/UART.cpp b/TESTS/API/UART/UART.cpp deleted file mode 100755 index 58a3302..0000000 --- a/TESTS/API/UART/UART.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// check if Seroa; is supported on this device -#if !DEVICE_SERIAL - #error [NOT_SUPPORTED] Serial (UART) not supported on this platform, add 'DEVICE_SERIAL' deffinition to your platform. -#endif - -#include "mbed.h" -#include "greentea-client/test_env.h" -#include "unity.h" -#include "utest.h" -//#include "rtos.h" - -using namespace utest::v1; -#define UART_SENTINAL 'x' - -Serial uart(MBED_CONF_APP_UART_TX,MBED_CONF_APP_UART_RX); - -// Test single Write / Read -void test_uart_single(){ - - char value = '0'; - uart.putc(UART_SENTINAL); - //printf("putc = %c\n",UART_SENTINAL); - value = uart.getc(); - //printf("getc = %c\n\n",value); - TEST_ASSERT(UART_SENTINAL == value); - if(UART_SENTINAL == value){ - // printf("Test Finished Successfully!\n"); - TEST_ASSERT_MESSAGE(true,"characters match!"); - } else{ - // printf("Test Failed! \n"); - TEST_ASSERT_MESSAGE(false,"characters do not match, possible corruption?"); - } -} - -// TODO: add more verbose tests -// - different speeds (9600 / 115200 / ...etc) -// - flush buffers -// - write longer strings -// - special characters -// - send break characters -// ...etc - -utest::v1::status_t test_setup(const size_t number_of_cases) { - // Setup Greentea using a reasonable timeout in seconds - GREENTEA_SETUP(40, "default_auto"); - return verbose_test_setup_handler(number_of_cases); -} - -// Handle test failures, keep testing, dont 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; -} - -// Test cases -// TODO: take pins from config file or from pinnames.h -Case cases[] = { - Case("UART on UART_RX/UART_TX, single byte W/R ", test_uart_single, greentea_failure_handler), -}; - -Specification specification(test_setup, cases); - -// Entry point into the tests -int main() { - return !Harness::run(specification); -} \ No newline at end of file diff --git a/TESTS/host_tests/uart.py b/TESTS/host_tests/uart.py deleted file mode 100644 index 129bc03..0000000 --- a/TESTS/host_tests/uart.py +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2016 ARM Limited, All rights reserved -# -# 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. - -from mbed_host_tests import BaseHostTest, event_callback - - -class: UARTEchoTest(BaseHostTest): - - def __init__(self): - """ - Initialise test parameters. - :return: - """ - BaseHostTest.__init__(self)