---
url: /reference/upload-formats-and-samples.md
---

# Supported Upload Formats and Samples

Teamscale supports a variety of external formats (e.g., test coverage) that can be uploaded and will then included in
the analysis (e.g., during Test Gap Analysis).

\[\[toc]]

## Supported Formats for Upload

This guide lists the report formats that Teamscale understands and gives some short hints on how to generate them. For
an overview over how reports can be uploaded to Teamscale, take a look
at [how to upload external analysis data to Teamscale](../../howto/uploading-external-data/).

:::tip Language-specific Coverage Tool Recommendations

If you want to setup a coverage tool, take a look at
the [Coverage Profiler Overview](../../howto/setting-up-profiler-tga/) listing page.
:::

### Findings

### Coverage

### Test Executions

### Other

## Example for XML File Format of Lauterbach Trace32 Coverage Report

```xml
<?xml version="1.0" encoding="iso-8859-1" standalone="no" ?>
<?xml-stylesheet type="text/xsl" href="t32transform.xsl"?>
<TRACE32 file="C:\T32\demo\t32cast\eca\mcdc\coverage\coverage\func-p-8000988-8000a0f.xml">
    <coverage>
        <COVerage.EXPORT.ListLine ts="1618396955" t32ver="S.2021.04.000134317MXD" t32pv="ARM" cpu="RM57L843-ZWT"
                                  metric="mcdc">
            ...
        </COVerage.EXPORT.ListLine>
    </coverage>
    <marker>
        <BookMark.EXPORT ts="1618396955" t32ver="S.2021.04.000134317MXD" t32pv="ARM" cpu="RM57L843-ZWT">
        </BookMark.EXPORT>
    </marker>
    <listing>
        <List.EXPORT ts="1618396955" t32ver="S.2021.04.000134317MXD" t32pv="ARM" order="source">
            ...
        </List.EXPORT>
    </listing>
</TRACE32>
```

## Example for JSON File Format for Teamscale Generic Findings

```json
[
  {
    "path": "com/acme/Foo.java",
    "findings": [
      {
        "findingTypeId": "myfinding-1",
        "message": "Invalid construct",
        "startLine": 14,
        "endLine": 14
      }
    ]
  },
  {
    "path": "com/acme/Foo2.java",
    "findings": [
      {
        "findingTypeId": "myfinding-2",
        "message": "Range not defined",
        "startLine": 12,
        "endLine": 44,
        "assessment": "RED"
      },
      {
        "findingTypeId": "myfinding-3",
        "message": "Finding with offsets",
        "startOffset": 1234,
        "endOffset": 2345
      }
    ]
  }
]
```

## Example for JSON File Format for Teamscale Non-Code Metrics

```json
[
  {
    "path": "metric1/value1",
    "count": 15
  },
  {
    "path": "metric1/value2",
    "count": 42,
    "content": "some text",
    "assessment": {
      "RED": 5,
      "YELLOW": 3,
      "GREEN": 1
    },
    "time": 3.145
  }
]
```

## Example File for Teamscale Simple Coverage

```
com/acme/Foo.java
5
7
9-12
com/acme/Foo2.java
45
46
47
48-50
51-55
```

## Example file for Teamscale CSV Issues

```
id,subject,assignee,author,description,created,updated,status,closed,url,parent
1,Broken Navigation,Bob,Bob,Broken Navigation,1,1,OPEN,false,,
```

## Example file for Teamscale CSV Spec Items

```
id,subject,assignee,author,description,created,updated,status,closed,url,additional_assignees,linkRoles,linkedRequirements,type,typeAbbreviation,parent,optOne,optTwo
1,Add included classes in renaming,Bob,Bob,Adding support for CSS function radial-gradient,1,1,closed,true,,,,,System Requirement,SR,3,An optional Field,Another optional field
```

## Example file for Clang Findings in JSON Extracted from XCResult Bundle

```json
{
  "actionTitle": "Build for Analyzing Foo Project",
  "analyzerWarningCount": 2,
  "analyzerWarnings": [
    {
      "className": "DVTTextDocumentLocation",
      "issueType": "Memory (Core Foundation/Objective-C/OSObject)",
      "message": "Potential leak of an object stored into 'ownerRef'",
      "sourceURL": "file:///clang_xcresult/Foo.c#EndingColumnNumber=90&EndingLineNumber=9&StartingColumnNumber=21&StartingLineNumber=9",
      "targetName": "Test Target"
    },
    {
      "className": "DVTTextDocumentLocation",
      "issueType": "Unused code",
      "message": "Value stored to 'string' during its initialization is never read",
      "sourceURL": "file:///clang_xcresult/Foo.c#EndingColumnNumber=16&EndingLineNumber=16&StartingColumnNumber=10&StartingLineNumber=16",
      "targetName": "Test Target"
    }
  ],
  "errorCount": 1,
  "errors": [
    {
      "className": "DVTTextDocumentLocation",
      "issueType": "Semantic Issue",
      "message": "Too many arguments to function call, expected 0, have 2",
      "sourceURL": "file:///clang_xcresult/Foo.c#EndingColumnNumber=27&EndingLineNumber=46&StartingColumnNumber=5&StartingLineNumber=46"
    }
  ],
  "warningCount": 2,
  "warnings": [
    {
      "className": "DVTTextDocumentLocation",
      "issueType": "Nullability Issue",
      "message": "Null passed to a parameter expecting non-null",
      "sourceURL": "file:///clang_xcresult/example.m#EndingColumnNumber=24&EndingLineNumber=20&StartingColumnNumber=20&StartingLineNumber=20",
      "targetName": "Test Target"
    },
    {
      "className": "DVTTextDocumentLocation",
      "issueType": "Value Conversion Issue",
      "message": "Implicit conversion loses integer precision",
      "sourceURL": "file:///clang_xcresult/example.c#EndingColumnNumber=34&EndingLineNumber=41&StartingColumnNumber=9&StartingLineNumber=41",
      "targetName": "Test Target"
    }
  ]
}
```
