Schemas

pyEDAA.Reports validates every file it reads against the schema of its format before converting it: an XML schema or a JSON Schema. It ships the schemas of the code coverage formats - e.g. Cobertura’s XML or coverage.py’s JSON report -, of the JUnit dialects and of Open Test Reporting; the schema of pyTooling’s test report comes with pyTooling. Each schema is listed here, the shipped ones with their full source, ready to read, to copy, or to download.

Available schemas

Schema

File

Read by

Any Cobertura

Any-Cobertura.xsd

pyEDAA.Reports.CodeCoverage.Cobertura.Document

Cobertura 04

Cobertura-04.xsd

strict translation of Cobertura’s DTD coverage-04.dtd

coverage.py Cobertura

CoveragePy-Cobertura.xsd

pyEDAA.Reports.CodeCoverage.Cobertura.CoveragePyCobertura.Document

NVC Cobertura

NVC-Cobertura.xsd

pyEDAA.Reports.CodeCoverage.Cobertura.NVCCobertura.Document

coverage.py JSON, format 2

CoveragePy-2.schema.json

pyEDAA.Reports.CodeCoverage.CoveragePy.Document

coverage.py JSON, format 3

CoveragePy-3.schema.json

pyEDAA.Reports.CodeCoverage.CoveragePy.Document

GHDL coverage 1.0.0

GHDL-Coverage-1.0.0.schema.json

pyEDAA.Reports.CodeCoverage.GHDL.Document

UCIS 1.0

UCIS-1.0.xsd

pyEDAA.Reports.CodeCoverage.UCIS.Document, UCIS version 1.0

pyucis UCIS 1.0

PyUCIS-1.0.xsd

pyEDAA.Reports.CodeCoverage.UCIS.PyUCIS.Document, UCIS version 1.0

gcov JSON 1

Gcov-1.schema.json

pyEDAA.Reports.CodeCoverage.Gcov.Document, format version 1

gcov JSON 2

Gcov-2.schema.json

pyEDAA.Reports.CodeCoverage.Gcov.Document, format version 2

JaCoCo 1.1

JaCoCo-1.1.xsd

pyEDAA.Reports.CodeCoverage.JaCoCo.Document, format version 1.1

Aldec UCDB

Aldec-UCDB.xsd

pyEDAA.Reports.CodeCoverage.AldecUCDB.Document

QuestaSim Coverage

QuestaSim-Coverage.xsd

pyEDAA.Reports.CodeCoverage.QuestaSim.Document

LLVM coverage JSON

LLVM-Coverage-JSON.schema.json

pyEDAA.Reports.CodeCoverage.LLVM.Document

Any JUnit

Any-JUnit.xsd

pyEDAA.Reports.Unittesting.JUnit.Document

Ant + JUnit4

Ant-JUnit4.xsd

pyEDAA.Reports.Unittesting.JUnit.AntJUnit4.Document

Catch2 JUnit

Catch2-JUnit.xsd

pyEDAA.Reports.Unittesting.JUnit.Catch2JUnit.Document

CTest JUnit

CTest-JUnit.xsd

pyEDAA.Reports.Unittesting.JUnit.CTestJUnit.Document

go-junit-report JUnit

GoJUnitReport-JUnit.xsd

pyEDAA.Reports.Unittesting.JUnit.GoJUnitReport.Document

GoogleTest JUnit

GoogleTest-JUnit.xsd

pyEDAA.Reports.Unittesting.JUnit.GoogleTestJUnit.Document

cargo-nextest JUnit

Nextest-JUnit.xsd

pyEDAA.Reports.Unittesting.JUnit.NextestJUnit.Document

pytest JUnit

PyTest-JUnit.xsd

pyEDAA.Reports.Unittesting.JUnit.PyTestJUnit.Document

JunitXml.TestLogger JUnit

TestLogger-JUnit.xsd

pyEDAA.Reports.Unittesting.JUnit.TestLoggerJUnit.Document

Open Test Reporting 0.2.0

OpenTestReporting/OpenTestReporting-0.2.0.xsd

pyEDAA.Reports.Unittesting.OpenTestReporting.Events.Document, pyEDAA.Reports.Unittesting.OpenTestReporting.Hierarchy.Document

pyTooling TestReport v0.1

TestReport-v0.1.xsd

pyEDAA.Reports.Unittesting.pyTooling.Document

TestReport-v0.1.xsd is pyTooling’s: the reader takes it from pyTooling.Resources, and its source is on pyTooling’s schema page.

Reaching a schema from Python

The schemas are shipped in the resource package pyEDAA.Reports.Resources. Two functions of pyTooling reach a resource file, whether pyEDAA.Reports is installed, inside a wheel, or a checkout: getResourceFile() returns its path, for handing the file to another tool, and readResourceFile() returns its content, for reading it directly.

example.py

from pathlib          import Path
from pyTooling.Common import getResourceFile, readResourceFile

from pyEDAA.Reports   import Resources  # Declare a module name that can be handed over.

schemaPath:    Path = getResourceFile(Resources, "PyTest-JUnit.xsd")
schemaContent: str  = readResourceFile(Resources, "PyTest-JUnit.xsd")