Mistake on this page?
Report an issue in GitHub or email us
test_env.h
1 
2 /** \addtogroup frameworks */
3 /** @{*/
4 /*
5  * Copyright (c) 2013-2016, ARM Limited, All Rights Reserved
6  * SPDX-License-Identifier: Apache-2.0
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License"); you may
9  * not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #ifndef GREENTEA_CLIENT_TEST_ENV_H_
22 #define GREENTEA_CLIENT_TEST_ENV_H_
23 
24 #ifdef __cplusplus
25 #define MBED_GREENTEA_CLIENT_VERSION_STRING "1.3.0"
26 
27 #include <stdio.h>
28 
29 /**
30  * Auxilary macros
31  */
32 #ifndef NL
33 #define NL "\n"
34 #endif
35 #ifndef RCNL
36 #define RCNL "\r\n"
37 #endif
38 
39 /**
40  * Ensure compatibility with utest
41  */
42 #define TEST_ENV_TESTCASE_COUNT GREENTEA_TEST_ENV_TESTCASE_COUNT
43 #define TEST_ENV_TESTCASE_START GREENTEA_TEST_ENV_TESTCASE_START
44 #define TEST_ENV_TESTCASE_FINISH GREENTEA_TEST_ENV_TESTCASE_FINISH
45 #define TEST_ENV_TESTCASE_SUMMARY GREENTEA_TEST_ENV_TESTCASE_SUMMARY
46 
47 /**
48  * Default length for UUID buffers (used during the sync process)
49  */
50 #define GREENTEA_UUID_LENGTH 48
51 
52 /**
53  * Generic test suite transport protocol keys
54  */
55 extern const char* GREENTEA_TEST_ENV_END;
56 extern const char* GREENTEA_TEST_ENV_EXIT;
57 extern const char* GREENTEA_TEST_ENV_SYNC;
58 extern const char* GREENTEA_TEST_ENV_TIMEOUT;
59 extern const char* GREENTEA_TEST_ENV_HOST_TEST_NAME;
60 extern const char* GREENTEA_TEST_ENV_HOST_TEST_VERSION;
61 
62 /**
63  * Test suite success code strings
64  */
65 extern const char* GREENTEA_TEST_ENV_SUCCESS;
66 extern const char* GREENTEA_TEST_ENV_FAILURE;
67 
68 /**
69  * Test case transport protocol start/finish keys
70  */
71 extern const char* GREENTEA_TEST_ENV_TESTCASE_NAME;
72 extern const char* GREENTEA_TEST_ENV_TESTCASE_COUNT;
73 extern const char* GREENTEA_TEST_ENV_TESTCASE_START;
74 extern const char* GREENTEA_TEST_ENV_TESTCASE_FINISH;
75 extern const char* GREENTEA_TEST_ENV_TESTCASE_SUMMARY;
76 
77 /**
78  * Code Coverage (LCOV) transport protocol keys
79  */
80 extern const char* GREENTEA_TEST_ENV_LCOV_START;
81 
82 /**
83  * Greentea-client related API for communication with host side
84  */
85 void GREENTEA_SETUP_UUID(const int timeout, const char *host_test_name, char *buffer, size_t size);
86 void GREENTEA_TESTSUITE_RESULT(const int);
87 void GREENTEA_TESTCASE_START(const char *test_case_name);
88 void GREENTEA_TESTCASE_FINISH(const char *test_case_name, const size_t passes, const size_t failed);
89 
90 /**
91  * Test suite result related notification API
92  */
93 void greentea_send_kv(const char *, const int);
94 void greentea_send_kv(const char *, const int, const int);
95 void greentea_send_kv(const char *, const char *, const int);
96 void greentea_send_kv(const char *, const char *, const int, const int);
97 
98 #ifdef MBED_CFG_DEBUG_OPTIONS_COVERAGE
99 /**
100  * Code Coverage API
101  */
102 void greentea_notify_coverage_start(const char *path);
103 void greentea_notify_coverage_end();
104 #endif // MBED_CFG_DEBUG_OPTIONS_COVERAGE
105 
106 #endif // __cplusplus
107 
108 #ifdef __cplusplus
109 extern "C" {
110 #endif
111 
112 /**
113  * Greentea-client C API
114  */
115 void GREENTEA_SETUP(const int timeout, const char * host_test);
116 void greentea_send_kv(const char * key, const char * val);
117 int greentea_parse_kv(char * key, char * val,
118  const int key_len, const int val_len);
119 int greentea_getc();
120 void greentea_putc(int c);
121 void greentea_write_string(const char *str);
122 
123 #ifdef __cplusplus
124 }
125 #endif
126 
127 #endif // GREENTEA_CLIENT_TEST_ENV_H_
128 
129 /** @}*/
void GREENTEA_SETUP(const int timeout, const char *host_test)
Greentea-client C API.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.