takashi kadono
/
Nucleo_446
Color Oled(SSD1331) connect to STMicroelectronics Nucleo-F466
mbed-os/TESTS/network/emac/main.cpp@3:f3764f852aa8, 2018-10-11 (annotated)
- Committer:
- kadonotakashi
- Date:
- Thu Oct 11 02:27:46 2018 +0000
- Revision:
- 3:f3764f852aa8
- Parent:
- 0:8fdf9a60065b
Nucreo 446 + SSD1331 test version;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kadonotakashi | 0:8fdf9a60065b | 1 | /* |
kadonotakashi | 0:8fdf9a60065b | 2 | * Copyright (c) 2017, ARM Limited, All Rights Reserved |
kadonotakashi | 0:8fdf9a60065b | 3 | * SPDX-License-Identifier: Apache-2.0 |
kadonotakashi | 0:8fdf9a60065b | 4 | * |
kadonotakashi | 0:8fdf9a60065b | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may |
kadonotakashi | 0:8fdf9a60065b | 6 | * not use this file except in compliance with the License. |
kadonotakashi | 0:8fdf9a60065b | 7 | * You may obtain a copy of the License at |
kadonotakashi | 0:8fdf9a60065b | 8 | * |
kadonotakashi | 0:8fdf9a60065b | 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
kadonotakashi | 0:8fdf9a60065b | 10 | * |
kadonotakashi | 0:8fdf9a60065b | 11 | * Unless required by applicable law or agreed to in writing, software |
kadonotakashi | 0:8fdf9a60065b | 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
kadonotakashi | 0:8fdf9a60065b | 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
kadonotakashi | 0:8fdf9a60065b | 14 | * See the License for the specific language governing permissions and |
kadonotakashi | 0:8fdf9a60065b | 15 | * limitations under the License. |
kadonotakashi | 0:8fdf9a60065b | 16 | */ |
kadonotakashi | 0:8fdf9a60065b | 17 | |
kadonotakashi | 0:8fdf9a60065b | 18 | #if !defined(MBED_CONF_APP_ECHO_SERVER) || \ |
kadonotakashi | 0:8fdf9a60065b | 19 | !defined(MBED_CONF_APP_ECHO_SERVER_TRACE) || \ |
kadonotakashi | 0:8fdf9a60065b | 20 | !defined(MBED_CONF_APP_WIFI_SCAN) |
kadonotakashi | 0:8fdf9a60065b | 21 | #error [NOT_SUPPORTED] Requires parameters from mbed_app.json |
kadonotakashi | 0:8fdf9a60065b | 22 | #endif |
kadonotakashi | 0:8fdf9a60065b | 23 | |
kadonotakashi | 0:8fdf9a60065b | 24 | #define ETHERNET 1 |
kadonotakashi | 0:8fdf9a60065b | 25 | #define WIFI 2 |
kadonotakashi | 0:8fdf9a60065b | 26 | |
kadonotakashi | 0:8fdf9a60065b | 27 | #if MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE != ETHERNET && \ |
kadonotakashi | 0:8fdf9a60065b | 28 | MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE != WIFI |
kadonotakashi | 0:8fdf9a60065b | 29 | #error [NOT_SUPPORTED] Either wifi or ethernet testing need to be enabled |
kadonotakashi | 0:8fdf9a60065b | 30 | #endif |
kadonotakashi | 0:8fdf9a60065b | 31 | |
kadonotakashi | 0:8fdf9a60065b | 32 | #if MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE == WIFI |
kadonotakashi | 0:8fdf9a60065b | 33 | #if !defined(TARGET_UBLOX_EVK_ODIN_W2) && \ |
kadonotakashi | 0:8fdf9a60065b | 34 | !defined(TARGET_REALTEK_RTL8195AM) && \ |
kadonotakashi | 0:8fdf9a60065b | 35 | !defined(TARGET_MTB_ADV_WISE_1530) && \ |
kadonotakashi | 0:8fdf9a60065b | 36 | !defined(TARGET_MTB_USI_WM_BN_BM_22) && \ |
kadonotakashi | 0:8fdf9a60065b | 37 | !defined(TARGET_MTB_MXCHIP_EMW3166) && \ |
kadonotakashi | 0:8fdf9a60065b | 38 | !defined(TARGET_MTB_UBLOX_ODIN_W2) |
kadonotakashi | 0:8fdf9a60065b | 39 | #error [NOT_SUPPORTED] Wifi tests are not valid for the target |
kadonotakashi | 0:8fdf9a60065b | 40 | #endif |
kadonotakashi | 0:8fdf9a60065b | 41 | #endif |
kadonotakashi | 0:8fdf9a60065b | 42 | |
kadonotakashi | 0:8fdf9a60065b | 43 | #include "greentea-client/test_env.h" |
kadonotakashi | 0:8fdf9a60065b | 44 | #include "unity.h" |
kadonotakashi | 0:8fdf9a60065b | 45 | #include "utest.h" |
kadonotakashi | 0:8fdf9a60065b | 46 | |
kadonotakashi | 0:8fdf9a60065b | 47 | #include "emac_tests.h" |
kadonotakashi | 0:8fdf9a60065b | 48 | #include "emac_util.h" |
kadonotakashi | 0:8fdf9a60065b | 49 | |
kadonotakashi | 0:8fdf9a60065b | 50 | using namespace utest::v1; |
kadonotakashi | 0:8fdf9a60065b | 51 | |
kadonotakashi | 0:8fdf9a60065b | 52 | // Test setup |
kadonotakashi | 0:8fdf9a60065b | 53 | utest::v1::status_t test_setup(const size_t number_of_cases) |
kadonotakashi | 0:8fdf9a60065b | 54 | { |
kadonotakashi | 0:8fdf9a60065b | 55 | #if !MBED_CONF_APP_ECHO_SERVER |
kadonotakashi | 0:8fdf9a60065b | 56 | GREENTEA_SETUP(1200, "default_auto"); |
kadonotakashi | 0:8fdf9a60065b | 57 | #endif |
kadonotakashi | 0:8fdf9a60065b | 58 | return verbose_test_setup_handler(number_of_cases); |
kadonotakashi | 0:8fdf9a60065b | 59 | } |
kadonotakashi | 0:8fdf9a60065b | 60 | |
kadonotakashi | 0:8fdf9a60065b | 61 | Case cases[] = { |
kadonotakashi | 0:8fdf9a60065b | 62 | Case("EMAC initialize", test_emac_initialize), |
kadonotakashi | 0:8fdf9a60065b | 63 | Case("EMAC broadcast", test_emac_broadcast), |
kadonotakashi | 0:8fdf9a60065b | 64 | Case("EMAC unicast", test_emac_unicast), |
kadonotakashi | 0:8fdf9a60065b | 65 | Case("EMAC unicast frame length", test_emac_unicast_frame_len), |
kadonotakashi | 0:8fdf9a60065b | 66 | Case("EMAC unicast burst", test_emac_unicast_burst), |
kadonotakashi | 0:8fdf9a60065b | 67 | Case("EMAC unicast long", test_emac_unicast_long), |
kadonotakashi | 0:8fdf9a60065b | 68 | Case("EMAC multicast filter", test_emac_multicast_filter), |
kadonotakashi | 0:8fdf9a60065b | 69 | Case("EMAC memory", test_emac_memory) |
kadonotakashi | 0:8fdf9a60065b | 70 | }; |
kadonotakashi | 0:8fdf9a60065b | 71 | |
kadonotakashi | 0:8fdf9a60065b | 72 | Specification specification(test_setup, cases); |
kadonotakashi | 0:8fdf9a60065b | 73 | |
kadonotakashi | 0:8fdf9a60065b | 74 | int main() |
kadonotakashi | 0:8fdf9a60065b | 75 | { |
kadonotakashi | 0:8fdf9a60065b | 76 | return !Harness::run(specification); |
kadonotakashi | 0:8fdf9a60065b | 77 | } |
kadonotakashi | 0:8fdf9a60065b | 78 |