Toyomasa Watarai
/
Mbed-example-WS-W27
Mbed Cloud example program for workshop in W27 2018.
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 // ---------------------------------------------------------------------------- 00002 // Copyright 2016-2017 ARM Ltd. 00003 // 00004 // SPDX-License-Identifier: Apache-2.0 00005 // 00006 // Licensed under the Apache License, Version 2.0 (the "License"); 00007 // you may not use this file except in compliance with the License. 00008 // You may obtain a copy of the License at 00009 // 00010 // http://www.apache.org/licenses/LICENSE-2.0 00011 // 00012 // Unless required by applicable law or agreed to in writing, software 00013 // distributed under the License is distributed on an "AS IS" BASIS, 00014 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00015 // See the License for the specific language governing permissions and 00016 // limitations under the License. 00017 // ---------------------------------------------------------------------------- 00018 00019 #include <greentea-client/test_env.h> 00020 #include <utest/utest.h> 00021 #include <unity/unity.h> 00022 00023 #include "update-client-paal/arm_uc_paal_update_api.h" 00024 00025 using namespace utest::v1; 00026 00027 #if defined(TARGET_LIKE_POSIX) 00028 #include <unistd.h> 00029 #define __WFI() usleep(100) 00030 #endif 00031 00032 control_t syntax_check() 00033 { 00034 ARM_UC_PAAL_UPDATE test = { 0 }; 00035 00036 return CaseNext; 00037 } 00038 00039 Case cases[] = { 00040 Case("syntax_check", syntax_check), 00041 }; 00042 00043 utest::v1::status_t greentea_setup(const size_t number_of_cases) 00044 { 00045 #if defined(TARGET_LIKE_MBED) 00046 GREENTEA_SETUP(60, "default_auto"); 00047 #endif 00048 return greentea_test_setup_handler(number_of_cases); 00049 } 00050 00051 Specification specification(greentea_setup, cases); 00052 00053 #if defined(TARGET_LIKE_MBED) 00054 int main() 00055 #elif defined(TARGET_LIKE_POSIX) 00056 void app_start(int argc __unused, char** argv __unused) 00057 #endif 00058 { 00059 // Run the test specification 00060 Harness::run(specification); 00061 }
Generated on Tue Jul 12 2022 16:22:07 by 1.7.2