diff --git a/vunit/test/unit/test_test_report.py b/vunit/test/unit/test_test_report.py index df0b79d79f..c395b3d4f4 100644 --- a/vunit/test/unit/test_test_report.py +++ b/vunit/test/unit/test_test_report.py @@ -13,6 +13,7 @@ from os.path import join, dirname import os from vunit.test_report import TestReport, PASSED, SKIPPED, FAILED +from vunit.ui.results import Results class TestTestReport(TestCase): @@ -274,6 +275,29 @@ def test_junit_report_with_testcase_classname(self): ), ) + def test_dict_report_with_all_passed_tests(self): + test_path = dirname(self.output_file_name) + results = Results( + dirname(test_path), None, self._report_with_all_passed_tests(), + ) + report = results.get_report() + for _, val in report.tests.items(): + self.assertEqual( + join(report.output_path, val["path"], ""), + report.get_full_path(val["path"]), + ) + self.assertEqual( + join(report.output_path, val["path"], "output.txt"), + report.get_full_path(val["path"], "output.txt"), + ) + self.assertEqual( + report.tests, + { + "passed_test0": {"status": "passed", "time": 1.0, "path": test_path}, + "passed_test1": {"status": "passed", "time": 2.0, "path": test_path}, + }, + ) + def _report_with_all_passed_tests(self): " @returns A report with all passed tests " report = self._new_report()