aboutsummaryrefslogtreecommitdiff
path: root/lldb/test/API/commands/trace/TestTraceSchema.py
blob: b4e301504bd31499260e040d750df32be20b89d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import lldb
from intelpt_testcase import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
from lldbsuite.test.decorators import *


class TestTraceLoad(TraceIntelPTTestCaseBase):
    def testSchema(self):
        self.expect("trace schema intel-pt", substrs=["triple", "threads", "iptTrace"])

    def testInvalidPluginSchema(self):
        self.expect(
            "trace schema invalid-plugin",
            error=True,
            substrs=[
                'error: no trace plug-in matches the specified type: "invalid-plugin"'
            ],
        )

    def testAllSchemas(self):
        self.expect(
            "trace schema all",
            substrs=[
                """{
  "type": "intel-pt",
  "cpuInfo": {
    // CPU information gotten from, for example, /proc/cpuinfo.

    "vendor": "GenuineIntel" | "unknown",
    "family": integer,
    "model": integer,
    "stepping": integer
  },"""
            ],
        )