Marco Mayer / Mbed OS Queue
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 /*
00002  * Copyright (c) 2017, ARM Limited, All Rights Reserved
00003  * SPDX-License-Identifier: Apache-2.0
00004  *
00005  * Licensed under the Apache License, Version 2.0 (the "License"); you may
00006  * not use this file except in compliance with the License.
00007  * You may obtain a copy of the License at
00008  *
00009  * http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
00013  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 
00018 #include "mbed.h"
00019 #include "greentea-client/test_env.h"
00020 #include "unity.h"
00021 #include "utest.h"
00022 #include "wifi_tests.h"
00023 
00024 // Test for parameters
00025 #if !defined(MBED_CONF_APP_AP_MAC_SECURE)      || \
00026     !defined(MBED_CONF_APP_AP_MAC_UNSECURE)    || \
00027     !defined(MBED_CONF_APP_MAX_SCAN_SIZE)      || \
00028     !defined(MBED_CONF_APP_WIFI_CH_SECURE)     || \
00029     !defined(MBED_CONF_APP_WIFI_CH_UNSECURE)   || \
00030     !defined(MBED_CONF_APP_WIFI_DRIVER)        || \
00031     !defined(MBED_CONF_APP_WIFI_PASSWORD)      || \
00032     !defined(MBED_CONF_APP_WIFI_RX)            || \
00033     !defined(MBED_CONF_APP_WIFI_SECURE_SSID)   || \
00034     !defined(MBED_CONF_APP_WIFI_TX)            || \
00035     !defined(MBED_CONF_APP_WIFI_UNSECURE_SSID)
00036 #error [NOT_SUPPORTED] Requires parameters from mbed_app.json
00037 #endif
00038 
00039 using namespace utest::v1;
00040 
00041 utest::v1::status_t test_setup(const size_t number_of_cases) {
00042     GREENTEA_SETUP(240, "default_auto");
00043     return verbose_test_setup_handler(number_of_cases);
00044 }
00045 
00046 // Test cases
00047 Case cases[] = {
00048     Case("WIFI-CONSTRUCTOR", wifi_constructor),
00049     Case("WIFI-SET-CREDENTIAL", wifi_set_credential),
00050     Case("WIFI-SET-CHANNEL", wifi_set_channel),
00051     Case("WIFI-GET-RSSI", wifi_get_rssi),
00052     Case("WIFI-CONNECT-PARAMS-NULL", wifi_connect_params_null),
00053     Case("WIFI-CONNECT-PARAMS-VALID-UNSECURE", wifi_connect_params_valid_unsecure),
00054     Case("WIFI-CONNECT-PARAMS-VALID-SECURE", wifi_connect_params_valid_secure),
00055     Case("WIFI-CONNECT-PARAMS-CHANNEL", wifi_connect_params_channel),
00056     Case("WIFI-CONNECT-PARAMS-CHANNEL-FAIL", wifi_connect_params_channel_fail),
00057     Case("WIFI-CONNECT-NOCREDENTIALS", wifi_connect_nocredentials),
00058     Case("WIFI-CONNECT", wifi_connect),
00059     Case("WIFI-CONNECT-SECURE", wifi_connect_secure),
00060     Case("WIFI-CONNECT-SECURE-FAIL", wifi_connect_secure_fail),
00061     Case("WIFI-CONNECT-DISCONNECT-REPEAT", wifi_connect_disconnect_repeat),
00062     Case("WIFI-SCAN-NULL", wifi_scan_null),
00063     Case("WIFI-SCAN", wifi_scan),
00064 };
00065 
00066 Specification specification(test_setup, cases);
00067 
00068 // Entry point into the tests
00069 int main() {
00070     return !Harness::run(specification);
00071 }