1import lldb
2from lldbsuite.test.lldbtest import *
3from lldbsuite.test import lldbutil
4from lldbsuite.test.decorators import *
5
6class TestTraceLoad(TestBase):
7
8    mydir = TestBase.compute_mydir(__file__)
9    NO_DEBUG_INFO_TESTCASE = True
10
11    def setUp(self):
12        TestBase.setUp(self)
13        if 'intel-pt' not in configuration.enabled_plugins:
14            self.skipTest("The intel-pt test plugin is not enabled")
15
16
17    def testSchema(self):
18        self.expect("trace schema intel-pt", substrs=["trace", "triple", "threads", "traceFile"])
19
20    def testInvalidPluginSchema(self):
21        self.expect("trace schema invalid-plugin", error=True,
22            substrs=['error: no trace plug-in matches the specified type: "invalid-plugin"'])
23
24    def testAllSchemas(self):
25        self.expect("trace schema all", substrs=['''{
26  "trace": {
27    "type": "intel-pt",
28    "pt_cpu": {
29      "vendor": "intel" | "unknown",
30      "family": integer,
31      "model": integer,
32      "stepping": integer
33    }
34  },'''])
35