1import lldb
2from intelpt_testcase import *
3from lldbsuite.test.lldbtest import *
4from lldbsuite.test import lldbutil
5from lldbsuite.test.decorators import *
6
7class TestTraceLoad(TraceIntelPTTestCaseBase):
8
9    def testSchema(self):
10        self.expect("trace schema intel-pt", substrs=["triple", "threads", "iptTrace"])
11
12    def testInvalidPluginSchema(self):
13        self.expect("trace schema invalid-plugin", error=True,
14            substrs=['error: no trace plug-in matches the specified type: "invalid-plugin"'])
15
16    def testAllSchemas(self):
17        self.expect("trace schema all", substrs=['''{
18  "type": "intel-pt",
19  "cpuInfo": {
20    // CPU information gotten from, for example, /proc/cpuinfo.
21
22    "vendor": "GenuineIntel" | "unknown",
23    "family": integer,
24    "model": integer,
25    "stepping": integer
26  },'''])
27