You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
I have searched the issue tracker for a similar issue and not found a similar issue.
IDF version.
5.5-dev-2182-ga6c3a9cbbb
Operating System used.
Linux
How did you build your project?
VS Code IDE
If you are using Windows, please specify command line type.
None
What is the expected behavior?
When running a unit test program it should call the TEST_CASE's in the order in which they are entered.
While individual unit tests should be entirely standalone (setting up and deleting their own dependencies) it is often the case that each test might build on the previous one (not data wise, logic wise). A group of tests might first test the i2c bus can be created. A second test might create an i2c bus and add a device. A third test might create an i2c bus, add a device, and check the device is present... etc.
This is how it works when you compile "on chip".
What is the actual behavior?
When monitoring a unit test program that is compiled to run "on chip" the TEST_CASE's are run in the order in which they are entered.
When the same program is compiled to run on the host the TEST_CASE's are run in reverse order.
Steps to reproduce.
Create a new project using the unit_test as the base
Compile the unit_test "test" to run on chip
Run program
Output is in logical "entered" order
Compile the unit_test "test" to run on linux
Run program
Output is in reversed order
Build or installation Logs.
More Information.
Output on esp32c6 after pressing enter:
(1) "Mean of an empty array is zero" [mean]
(2) "Mean of a test vector" [mean]
(3) "Another test case which fails" [mean][fails]
Output on linux after pressing Enter:
(1) "Another test case which fails" [mean][fails]
(2) "Mean of a test vector" [mean]
(3) "Mean of an empty array is zero" [mean]
The text was updated successfully, but these errors were encountered:
github-actionsbot
changed the title
Device target linux causes unit testing order to reverse from on chip order
Device target linux causes unit testing order to reverse from on chip order (IDFGH-14790)
Mar 6, 2025
I did wonder about my wording of that bit. What I meant was standalone tests going a bit further each time. So test 1 creates the thing = pass. Test 2 creates the thing and then uses it with wrong parameters = fail = pass. Then test 3 creates the thing and uses it correctly = pass. So each test is testing a part of the same thing, all created from scratch each time with no interdependence on previous tests.
Anyways. Thanks for looking into this. Much appreciated.
Answers checklist.
IDF version.
5.5-dev-2182-ga6c3a9cbbb
Operating System used.
Linux
How did you build your project?
VS Code IDE
If you are using Windows, please specify command line type.
None
What is the expected behavior?
When running a unit test program it should call the TEST_CASE's in the order in which they are entered.
While individual unit tests should be entirely standalone (setting up and deleting their own dependencies) it is often the case that each test might build on the previous one (not data wise, logic wise). A group of tests might first test the i2c bus can be created. A second test might create an i2c bus and add a device. A third test might create an i2c bus, add a device, and check the device is present... etc.
This is how it works when you compile "on chip".
What is the actual behavior?
When monitoring a unit test program that is compiled to run "on chip" the TEST_CASE's are run in the order in which they are entered.
When the same program is compiled to run on the host the TEST_CASE's are run in reverse order.
Steps to reproduce.
Build or installation Logs.
More Information.
Output on esp32c6 after pressing enter:
Output on linux after pressing Enter:
The text was updated successfully, but these errors were encountered: