From eb9bb7bf3318e42313f45f14f6837e330e1cf530 Mon Sep 17 00:00:00 2001 From: Rajkumar Kanagaraj <45570536+rajkan01@users.noreply.github.com> Date: Wed, 23 Dec 2020 08:29:22 -0800 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Hugues Kamba <41612201+hugueskamba@users.noreply.github.com> --- tools/cmake/README.md | 18 +++++++++++------- tools/cmake/mbed_greentea.cmake | 18 +++++++++--------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/tools/cmake/README.md b/tools/cmake/README.md index cc72ae6f73..e027944b45 100644 --- a/tools/cmake/README.md +++ b/tools/cmake/README.md @@ -80,16 +80,20 @@ cmake -S -B -DCMAKE_BUILD_TYPE=debug ## How to build a greentea test Install prerequisites suggested in the previous section and follow the below steps to build: -* Generate .mbed_build configuration for DISCO_L475VG_IOT01A target from blinky example and copied into the test_suite directory. -* Change directory into the test suite directory -* run below command to build full profile green tea +* Generate the `.mbedbuild/` configuration directory for the Mbed target you want to run the test on using [mbed-os-example-blinky](https://github.com/ARMmbed/mbed-os-example-blinky) +``` +$ mbedtools configure -t -m +``` +* Copy `.mbedbuild/` into the test suite directory. +* Set your current directory to the test suite directory +* Run the following command to build the test binary with the full profile ``` - touch mbed-os.lib;mkdir build;cd build;cmake .. -GNinja;cmake --build . + touch mbed-os.lib && mkdir cmake_build && cd cmake_build && cmake .. -G Ninja && cmake --build . ``` -* run below command to build baremetal profile green tea +* Run the following command to build the test binary with the baremetal profile ``` - touch mbed-os.lib;mkdir build;cd build;cmake .. -GNinja -DMBED_BAREMETAL_GREENTEA_TEST=ON;cmake --build . + touch mbed-os.lib && mkdir cmake_build && cd cmake_build && cmake .. -G Ninja -DMBED_BAREMETAL_GREENTEA_TEST=ON && cmake --build . ``` -Note: This steps will get evolve once mbedtools have a proper way of invoking greentea test using mbedtools command +Note: These steps will change when `mbedtools` implements a sub-command to invoke Greentea tests diff --git a/tools/cmake/mbed_greentea.cmake b/tools/cmake/mbed_greentea.cmake index 71533fc8ae..a477196e33 100644 --- a/tools/cmake/mbed_greentea.cmake +++ b/tools/cmake/mbed_greentea.cmake @@ -23,16 +23,16 @@ include(${MBED_PATH}/tools/cmake/app.cmake) macro(mbed_greentea_cmake_macro) set(options) set(singleValueArgs TEST_NAME) - set(multipleValueArgs - TEST_INCLUDE_DIRS - TEST_SOURCES - TEST_REQUIRED_LIBS + set(multipleValueArgs + TEST_INCLUDE_DIRS + TEST_SOURCES + TEST_REQUIRED_LIBS ) - cmake_parse_arguments(MBED_GREENTEA - "${options}" - "${singleValueArgs}" - "${multipleValueArgs}" - ${ARGN} + cmake_parse_arguments(MBED_GREENTEA + "${options}" + "${singleValueArgs}" + "${multipleValueArgs}" + ${ARGN} ) set(TEST_NAME ${MBED_GREENTEA_TEST_NAME})