Open lightway29 opened 1 year ago
Hi @lightway29, there might be a conflict between the Unity distribution bundled with the mbed package and the one used by PlatformIO. Could you please try to add a special file .mbedignore
to the root of your project (next to platformio.ini
) with the following content:
mbed-os/features/frameworks/unity/*
Then clean and test again.
> Hi @lightway29, there might be a conflict between the Unity distribution bundled with the mbed package and the one used by PlatformIO. Could you please try to add a special file .mbedignore
to the root of your project (next to platformio.ini
) with the following content:
mbed-os/features/frameworks/unity/*
Then clean and test again.
Hi @valeros,
Cleaned and checked including the `mbedignore' file to the root. Still get the same result.
Have attached the sample project if it helps pio-testframework-mbed.zip
That's strange, what version of the nxplpc
dev-platform are you using?
That's strange, what version of the
nxplpc
dev-platform are you using?
@valeros @ivankravets I have also experimented on the following
nxplpc
5.3.0 and 9.0.0 then by installing 10.0.0 FYI - I tried with Arduino and that works perfectly
Please delete all previous platform instances, clean the project, run your tests in verbose mode via pio test -vvv > piotest.log.txt 2>&1
and attach here that log file.
Please delete all previous platform instances, clean the project, run your tests in verbose mode via
pio test -vvv > piotest.log.txt 2>&1
and attach here that log file.
@valeros
Attached piotest log file below.
Strange, according to the log file the Unity sources from the framework are still compiled even though they should be excluded from the build. What's more, I also compiled your project example and it seems to work as expected on Linux and Windows. What happens if you manually remove the /Users/YOUR_USER/.platformio/packages/framework-mbed/features/frameworks/unity
folder?
Strange, according to the log file the Unity sources from the framework are still compiled even though they should be excluded from the build. What's more, I also compiled your project example and it seems to work as expected on Linux and Windows. What happens if you manually remove the
/Users/YOUR_USER/.platformio/packages/framework-mbed/features/frameworks/unity
folder?
@valeros That did the trick. Removed all the frameworks related to Mbed and ran the code it worked fine. One thing I have noticed is that the board needs to be removed and plugged back again every time I run the test. Simply pressing the reset button won't run the test.
One thing I have noticed is that the board needs to be removed and plugged back again every time I run the test. Simply pressing the reset button won't run the test.
Not sure how the USB communication is implemented on this board, maybe it's a virtual COM port, so you can try adding a delay before UNITY_BEGIN just to make sure the MCU have enough time to reinitialize USB.
I have a similar issue: when running several testcases, it works perfectly in native environment, but on the target (Arduino Mega 2560), it sometimes runs all, sometimes only the last one, and sometimes the latter twice (-> see this issue here). However, I do not have the mbed package, thus, cannot remove it. Maybe this is the same bug? See the description in platformio forum here: https://community.platformio.org/t/unit-test-runs-only-one-testcase-on-target/42778
Trying to run a sample test case for mbed framework. Got everything working but running into an issue where the same test case runs twice and one fails and one passes.
https://community.platformio.org/t/platformio-unit-test-runs-the-same-test-case-twice/36404/3
platformio.ini
test_sample.cpp
Folder structure