Skip to content

Commit 545d229

Browse files
author
Cruz Monrreal
authored
Merge pull request #9497 from ARMmbed/AnotherButler-patch-2
Remove yotta from README.md
2 parents 953acef + 36438a1 commit 545d229

File tree

1 file changed

+15
-119
lines changed

1 file changed

+15
-119
lines changed
Lines changed: 15 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,21 @@
1-
# Table of Contents
1+
# Table of contents
22

33
* [greentea-client](#greentea-client)
4-
* [mbed-drivers dependencies](#mbed-drivers-dependencies)
5-
* [Greentea test tools](#greentea-test-tools)
6-
* [Compatibility](#compatibility)
7-
* [Greentea support](#greentea-support)
8-
* [utest support](#utest-support)
9-
* [greentea-client support in your module](#greentea-client-support-in-your-module)
10-
* [Terms](#terms)
4+
* [Concepts](#concepts)
115
* [Test suite](#test-suite)
126
* [Test case](#test-case)
137
* [key-value protocol](#key-value-protocol)
14-
* [Where can I use it?](#where-can-i-use-it)
15-
* [Test suite model](#test-suite-model)
16-
* [utest support template](#utest-support-template)
17-
* [No utest support template](#no-utest-support-template)
8+
* [Test example](#test-examplel)
189

1910
# greentea-client
2011

21-
**Tip:** If you are unsure about the terms used in this document, please see the [Terms](#Terms) section.
22-
23-
```greentea-client``` is a C++ client library for [the Greentea test tool](https://github.com/ARMmbed/greentea) when used in an [mbed](www.mbed.com) project.
24-
This package implements the slave side of the simple key-value protocol used for communication between the device under test (DUT) and the host. ```Greentea``` on the host side implements the protocol's master behavior. ```greentea-client``` is released through the [yotta registry](https://yotta.mbed.com/#/module/greentea-client/0.1.8).
12+
`greentea-client` is a client library for [the Greentea test tool](https://github.com/ARMmbed/mbed-os-tools/tree/master/packages/mbed-greentea) when used in an [Mbed OS](https://os.mbed.com/) project.
2513

14+
This package implements the client side of the key-value protocol used for communication between the device under test (DUT) and the host. The `Greentea` tool implements the protocol's host behavior. We use [utest](https://github.com/ARMmbed/mbed-os/blob/master/features/frameworks/utest/README.md) as our test harness.
2615

2716
```
28-
DUT <--- serial port connection ---> host
29-
(slave) . (master)
17+
DUT <--- serial port connection ---> host
18+
(client) . (host)
3019
.
3120
[greentea-client] . [conn_process] [htrun]
3221
===== . ================ =========
@@ -47,100 +36,24 @@ This package implements the slave side of the simple key-value protocol used fo
4736
.
4837
```
4938

50-
```greentea-client``` is a [yotta module](http://yottadocs.mbed.com/reference/module.html). You can easily include it in your yotta project as ```dependency```/```testDependency```.
51-
52-
## mbed-drivers dependencies
53-
54-
This package was introduced as a future replacement for the [mbed-drivers/test_env.h](https://github.com/ARMmbed/mbed-drivers/blob/master/mbed-drivers/test_env.h) test framework. ```mbed-drivers/test_env.h``` is no longer considered the correct way to write tests for mbed modules.
55-
56-
Examples of test cases ported from the old ```mbed-drivers/test_env``` to the ```greentea-client``` model can be found here:
57-
* [core-util](https://github.com/ARMmbed/core-util/pull/95)
58-
* [ualloc](https://github.com/ARMmbed/ualloc/pull/24)
59-
* [minar](https://github.com/ARMmbed/minar/pull/36)
60-
* [mbed-drivers](https://github.com/ARMmbed/mbed-drivers/pull/165)
61-
* [sal](https://github.com/ARMmbed/sal/pull/46)
62-
* [sockets](https://github.com/ARMmbed/sockets/pull/64)
63-
* [utest](https://github.com/ARMmbed/utest/pull/6)
64-
65-
## Greentea test tools
66-
67-
```Greentea``` is a test automation tool written in Python and designed to automate test execution for [mbed](www.mbed.com) projects encapsulated as [yotta](http://yottadocs.mbed.com) modules. Its key features include: integration with yotta module, test automation for yotta module's tests and reporting.
68-
69-
## Compatibility
70-
71-
```greentea-client``` is compatible with:
72-
* [Greentea](https://github.com/ARMmbed/greentea) v0.2.x onwards
73-
* [htrun](https://github.com/ARMmbed/htrun) v0.2.x onwards
74-
* [utest](https://github.com/ARMmbed/utest) v1.10.0 onwards
75-
* [unity](https://github.com/ARMmbed/utest) v2.0.1 onwards
76-
77-
### Greentea support
78-
79-
If you wish to use ```greentea-client``` please make sure you are using latest ```Greentea``` tools from [PyPI](https://pypi.python.org/pypi/mbed-greentea) (you will need Python 2.7):
80-
```
81-
$ pip install mbed-greentea --upgrade
82-
```
83-
84-
*Note*: If you previously used ```mbed-drivers/test_env.h``` features to write your test cases please downgrade ```Greentea``` to a version lower than ```v0.2.0``` to stay compatible:
85-
```
86-
$ pip install "mbed-greentea<0.2.0" --upgrade
87-
```
88-
89-
*Note*: [Greentea v0.1.x](https://github.com/ARMmbed/greentea/tree/master_v0_1_x) is still developed on a ```master_v0_1_x``` branch. We will only apply critical patches to version 0.1.x, no feature development is planned.
90-
91-
### utest support
92-
93-
```utest``` is our preferred test harness which allows you to execute a series of (asynchronous) C++ test cases. ```greentea-client``` includes as test dependency ```utest``` yotta module. See the ```greentea-client``` [module.json](https://github.com/ARMmbed/greentea-client/blob/master/module.json) ```testDependency``` section:
94-
```json
95-
{
96-
"testDependencies": {
97-
"utest": "^1.10.0"
98-
}
99-
}
100-
```
101-
102-
### greentea-client support in your module
103-
104-
Currently ```greentea-client``` is in on version ```1.0.x```. Please use a ```^1.0.0``` dependency version in your ```module.json``` file.
105-
106-
Example of ```module.json``` file with ```greentea-client``` as a test dependency:
107-
```json
108-
{
109-
"testDependencies": {
110-
"greentea-client": "^1.0.0",
111-
"utest" : "^1.10.0",
112-
"unity" : "^2.1.0"
113-
}
114-
}
115-
```
116-
117-
## Terms
39+
## Concepts
11840

11941
### Test suite
120-
A test suite is a binary containing test cases we execute on hardware. The test suite has a beginning and an end (like your ```main()``` function would. The test suite may pass, fail or be in an error state (for example if test suite times out or there was a serial port connection problem).
12142

122-
### Test case
43+
A test suite is a binary containing test cases we execute on hardware. The test suite has a beginning and an end (like the `main()` function would. The test suite may pass, fail or be in an error state (for example, if the test suite times out or there was a serial port connection problem).
12344

124-
Preferably you will use ```utest``` to define test cases . test case has the beginning and the end. During test case execution you will use ``ùnity``` assert macros, schedule MINAR callbacks, check for timeouts in your code. Your test cases may pass, fail or be in an error state which means something went wrong and we were unable to determine exactly what that was (you may have to check the logs).
45+
### Test case
12546

126-
### key-value protocol
47+
A test case is contained within a test suite. You can have multiple test cases within a test suite. `unity` assert macros are used to run the checks during the test case. Your test cases may pass, fail or be in an error state.
12748

128-
The key-value protocol (also called ```KiVi```) is a simple protocol introduced to the ```Greentea``` test tools. It is used to send simple text messages (events) between the DUT and the host. Each message consists of a _key_ and corresponding _value_ pair.
129-
A ```KiVi``` message is defined as a string encapsulated between double curly braces. The key and value are separated by a semicolon (```;```).
130-
For example: the ```{{timeout;120}}}``` string is a simple key-value message where the key "_timeout_" is associated with the value "_120_". Both ```greentea-client``` and ```Greentea``` understand this format and can detect key-value messages in a data stream. Both _key_ and _value_ are ASCII strings.
131-
This protocol is a master-slave protocol. The host has the role of _master_ and the DUT is the _slave_.
49+
### Key-value protocol
13250

133-
```greentea-client``` implements the key-value protocol tokenizer and parser.
51+
The key-value protocol is a protocol specific to the `Greentea` test tool. It is used to send messages (events) between the DUT and the host. Each message consists of a _key_ and _value_ pair. A message is surrounded by double curly braces. The key and value are separated by a semicolon (`;`).
13452

135-
## Where can I use it?
136-
It is possible to write test cases that use ```greentea-client``` and at the same time support ```mbed``` features such as [MINAR scheduler](https://github.com/ARMmbed/minar). It is also possible to mix ```greentea-client``` with other test tools we use at ```mbed``` such as [utest](https://github.com/ARMmbed/utest) and [unity](https://github.com/ARMmbed/unity).
53+
For example, the `{{timeout;120}}}` string is a key-value message where the key `timeout` has the value `120`. Both `greentea-client` and `Greentea` understand this format and can detect key-value messages in a data stream.
13754

138-
You can also find references to ```greentea-client``` in many ```mbed``` packages. For example:
139-
* [mbed-drivers](https://github.com/ARMmbed/mbed-drivers) - check its [module.json](https://github.com/ARMmbed/mbed-drivers/blob/master/module.json)
140-
* [core-util](https://github.com/ARMmbed/core-util) - check its [module.json](https://github.com/ARMmbed/core-util/blob/master/module.json)
55+
## Test example
14156

142-
# Test suite model
143-
## utest support template
14457
```c++
14558
#include "greentea-client/test_env.h"
14659
#include "utest/utest.h"
@@ -174,20 +87,3 @@ void app_start(int, char*[]) {
17487
Harness::run(specification);
17588
}
17689
```
177-
## No utest support template
178-
```c++
179-
#include "greentea-client/test_env.h"
180-
#include "unity/unity.h"
181-
182-
void app_start(int, char*[]) {
183-
bool result = true;
184-
GREENTEA_SETUP(15, "default_auto");
185-
186-
// Test suite body
187-
// Here you can run your test cases and or assertions
188-
TEST_ASSERT_TRUE(true);
189-
TEST_ASSERT_FALSE(false);
190-
191-
GREENTEA_TESTSUITE_RESULT(result);
192-
}
193-
```

0 commit comments

Comments
 (0)