2 Test TestBase test functions.
7 from lldbsuite
.test
.lldbtest
import *
8 from lldbsuite
.test_event
import build_exception
11 class TestBuildMethod(Base
):
15 self
.traceAlways
= True
17 # override the parent trace method
18 def trace(self
, *args
, **kwargs
):
20 print(*args
, file=buf
, **kwargs
)
21 self
._traces
.append(buf
.getvalue())
23 def test_build_fails_helpfully(self
):
25 self
.build(dictionary
={"CXX_SOURCES": "nonexisting-file.cpp"})
26 except build_exception
.BuildError
as e
:
27 self
.assertIn("nonexisting-file.cpp", str(e
))
29 self
.fail("BuildError not raised!")
31 def test_build_logs_traces(self
):
32 self
.build(dictionary
={"CXX_SOURCES": "return0.cpp"})
33 self
.assertIn("CXX_SOURCES", self
._traces
[0])
34 self
.assertIn("return0.o", self
._traces
[1])