twister: blackbox: coverage: fix matching pattern

Fix the expected pattern randomly matched to coverage.json contents
ordered differently at test_coverage_basedir().

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
This commit is contained in:
Dmitrii Golovanov 2024-10-08 21:53:39 +02:00 committed by Anas Nashif
parent fc90c9f824
commit 27456ed2b5
1 changed files with 2 additions and 2 deletions

View File

@ -47,7 +47,7 @@ class TestCoverage:
'coverage.log', 'coverage.json',
'coverage'
],
r'{"files": \[], "gcovr/format_version": ".*"}'
r'{"files": \[\], "gcovr/format_version": ".*"}'
),
]
TESTDATA_4 = [
@ -244,7 +244,7 @@ class TestCoverage:
with open(path, "r") as json_file:
json_content = json.load(json_file)
pattern = re.compile(expected_content)
assert pattern.match(json.dumps(json_content))
assert pattern.match(json.dumps(json_content, sort_keys=True))
if os.path.exists(base_dir):
os.rmdir(base_dir)