summaryrefslogtreecommitdiffstats
path: root/clang/bindings/python/tests
diff options
context:
space:
mode:
authorJonathan Coe <jbcoe@me.com>2017-09-06 07:33:32 +0000
committerJonathan Coe <jbcoe@me.com>2017-09-06 07:33:32 +0000
commitf3ecda6057e75d43d37ec823f939b23410c92eff (patch)
tree65bcd2dde3d3ec293ba965d828c449a09361d860 /clang/bindings/python/tests
parent761bb1b53df9b775a0c081167dd2bc839e9bfd81 (diff)
downloadbcm5719-llvm-f3ecda6057e75d43d37ec823f939b23410c92eff.tar.gz
bcm5719-llvm-f3ecda6057e75d43d37ec823f939b23410c92eff.zip
Fix __repr__ for Diagnostic in clang.cindex
Summary: Also move misplaced tests for exception specification to fix failing Python tests. Reviewers: hans, compnerd Reviewed By: compnerd Subscribers: cfe-commits Tags: #clang-c Differential Revision: https://reviews.llvm.org/D37490 llvm-svn: 312622
Diffstat (limited to 'clang/bindings/python/tests')
-rw-r--r--clang/bindings/python/tests/cindex/test_diagnostics.py8
-rw-r--r--clang/bindings/python/tests/cindex/test_exception_specification_kind.py (renamed from clang/bindings/python/tests/test_exception_specification_kind.py)0
2 files changed, 8 insertions, 0 deletions
diff --git a/clang/bindings/python/tests/cindex/test_diagnostics.py b/clang/bindings/python/tests/cindex/test_diagnostics.py
index ba6e545e8b1..23cbe89f658 100644
--- a/clang/bindings/python/tests/cindex/test_diagnostics.py
+++ b/clang/bindings/python/tests/cindex/test_diagnostics.py
@@ -92,3 +92,11 @@ def test_diagnostic_children():
assert children[0].spelling.endswith('declared here')
assert children[0].location.line == 1
assert children[0].location.column == 1
+
+def test_diagnostic_string_repr():
+ tu = get_tu('struct MissingSemicolon{}')
+ assert len(tu.diagnostics) == 1
+ d = tu.diagnostics[0]
+
+ assert repr(d) == '<Diagnostic severity 3, location <SourceLocation file \'t.c\', line 1, column 26>, spelling "expected \';\' after struct">'
+
diff --git a/clang/bindings/python/tests/test_exception_specification_kind.py b/clang/bindings/python/tests/cindex/test_exception_specification_kind.py
index 543d47f7db9..543d47f7db9 100644
--- a/clang/bindings/python/tests/test_exception_specification_kind.py
+++ b/clang/bindings/python/tests/cindex/test_exception_specification_kind.py
OpenPOWER on IntegriCloud