Serializing issue on Windows when gcov_tool specified to twister at the command line #83823
Labels
area: Twister
Twister
area: Windows Support
Related to building Zephyr on Windows
bug
The issue is a bug, or the PR is fixing a bug
priority: low
Low impact/importance bug
Describe the bug
I have a on target unit test that I am executing with twister and asking it to generate a code coverage report for. The build failed with this error:
Here is a copy of the report being passed to json.dump
The issue is that I am specifying a gcov_tool at the command line call to twister
twister....--coverage --gcov-tool my_windows_path...
And as you can see somehow twister is turning the gcov_tool path into a WindowsPath variable and not a string. And apparently a Windows Path type can't be in a dictionary passed to json.dump. That is the issue.
In reports.py I updated jason_report() to convert WindowsPath types in the report to strings, and that caused it to build fine. I am not suggesting that is the best answer, but something like it.
You also have to add this at the top to get it to build
from pathlib import WindowsPath
Here is the text of that code if you want to try it.
To Reproduce
Steps to reproduce the behavior:
twister....--coverage --gcov-tool my_windows_path...
Expected behavior
The unit test should build without error
Impact
Can't include coverage in my on target unit tests when running on windows.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: