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    mydir = TestBase.compute_mydir(__file__)
10
11    def testSchema(self):
12        self.expect("trace schema intel-pt", substrs=["trace", "triple", "threads", "traceFile"])
13
14    def testInvalidPluginSchema(self):
15        self.expect("trace schema invalid-plugin", error=True,
16            substrs=['error: no trace plug-in matches the specified type: "invalid-plugin"'])
17
18    def testAllSchemas(self):
19        self.expect("trace schema all", substrs=['''{
20  "trace": {
21    "type": "intel-pt",
22    "cpuInfo": {
23      "vendor": "intel" | "unknown",
24      "family": integer,
25      "model": integer,
26      "stepping": integer
27    }
28  },'''])
29