Skip to content

Commit

Permalink
Use standalone greentea-client
Browse files Browse the repository at this point in the history
For CMake or Mbed CLI 2, use the standalone greentea-client.
  • Loading branch information
Patater committed Jun 18, 2021
1 parent bcb491f commit 529fc80
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions features/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
# List of all features libraries available.
add_library(mbed-fpga-ci-test-shield INTERFACE)
add_library(mbed-client-cli INTERFACE)
add_library(mbed-greentea INTERFACE)
add_library(mbed-unity INTERFACE)
add_library(mbed-utest INTERFACE)

add_subdirectory(frameworks/COMPONENT_FPGA_CI_TEST_SHIELD)
add_subdirectory(frameworks/mbed-client-cli)
add_subdirectory(frameworks/greentea-client)
add_subdirectory(frameworks/unity)
add_subdirectory(frameworks/utest)
4 changes: 4 additions & 0 deletions features/frameworks/greentea-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

# greentea-client

*Note*: This copy of greentea-client is used only with Mbed CLI 1. Mbed CLI 2
will use the standalone greentea-client, automatically fetched by CMake [in the
`extern/` directory](../../../extern/README.md).

`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.

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.
Expand Down
4 changes: 2 additions & 2 deletions features/frameworks/unity/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

target_include_directories(mbed-greentea
target_include_directories(mbed-unity
INTERFACE
.
unity
)

target_sources(mbed-greentea
target_sources(mbed-unity
INTERFACE
source/unity.c
)
4 changes: 2 additions & 2 deletions features/frameworks/utest/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

target_include_directories(mbed-greentea
target_include_directories(mbed-utest
INTERFACE
.
utest
)

target_sources(mbed-greentea
target_sources(mbed-utest
INTERFACE
mbed-utest-shim.cpp
source/unity_handler.cpp
Expand Down
4 changes: 2 additions & 2 deletions tools/cmake/mbed_greentea.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ macro(mbed_greentea_add_test)
# -D "MBED_TEST_LINK_LIBRARIES=mbed-baremetal ext-errorlogging"
if (DEFINED MBED_TEST_LINK_LIBRARIES)
separate_arguments(MBED_TEST_LINK_LIBRARIES)
list(APPEND MBED_GREENTEA_TEST_REQUIRED_LIBS ${MBED_TEST_LINK_LIBRARIES} mbed-greentea)
list(APPEND MBED_GREENTEA_TEST_REQUIRED_LIBS ${MBED_TEST_LINK_LIBRARIES} greentea-client mbed-unity mbed-utest)
else()
list(APPEND MBED_GREENTEA_TEST_REQUIRED_LIBS mbed-greentea)
list(APPEND MBED_GREENTEA_TEST_REQUIRED_LIBS greentea-client mbed-unity mbed-utest)
endif()

target_link_libraries(${TEST_NAME}
Expand Down

0 comments on commit 529fc80

Please sign in to comment.