Mbed greentea utest header not found

Hi Sir,

I added a unit test according to:
Greentea testing applications - Tools | Mbed OS 5 Documentation

When I compile the simple test, tests-test-AcmInit-simple-test, the following compilation error happens:

    *[Fatal Error] main.cpp@7,10: 'utest/utest.h' file not found*
  •    [DEBUG] Return: 1*
    
  •    [DEBUG] Output: .\TESTS\test-AcmInit\simple-test\main.cpp:7:10: fatal error: 'utest/utest.h' file not found*
    
  •    [DEBUG] Output: #include "utest/utest.h"*
    
  •    [DEBUG] Output:          ^~~~~~~~~~~~~~~*
    
  •    [DEBUG] Output: 1 error generated.*
    

In my project custom_targets.json, I added “utest” in “requires”.

Can I know how to include folder of “\mbed-os\features\frameworks\unity” properly?

Thanks,
Shoujie

Hi,
how have you set up your program? How are you compiling it ? What version of Mbed OS are you using?
All this information is needed before we can start to help you…

Regards
Anna

Hi Anna,

Sorry for any confusion.

I am setting up a unit test for my normal project. The normal project compiles fine, but the unit test project cannot compile.

The Mbed OS is 6.9 and I am creating a test case according to:
https://os.mbed.com/docs/mbed-os/v6.9/debug-test/greentea-for-testing-applications.html

As far as my understanding, this is a problem of configuring the utest folder (\mbed-os\features\frameworks) into the test. (not in .includes_4401223b411031052ec32817b89f12dd.txt, the automatically generated include file list)

The compiling command starts from the normal project root and there are configuration items for the UT project:

mbed test -t ARMC6 -m UTT -n tests-test-Init-simple-test

Thanks a lot,
Shoujie

Hi there,

I got my unit test case compiled. I found in my root project folder file .mbedignore that utest and unity were commented out:

mbed-os/features/frameworks/unity/*
mbed-os/features/frameworks/utest/*

However, it reports another error:

mbedgt: detecting connected mbed-enabled devices…
mbedgt: no compatible devices detected
mbedgt: completed in 0.01 sec
mbedgt: exited with code 1

BTW, I am wondering where there is a checklist or FAQ for us to check these questions?

Thanks a lot,
Shoujie