summaryrefslogtreecommitdiff
path: root/gnu/llvm
diff options
context:
space:
mode:
authorPatrick Wildt <patrick@cvs.openbsd.org>2017-12-24 23:15:34 +0000
committerPatrick Wildt <patrick@cvs.openbsd.org>2017-12-24 23:15:34 +0000
commit59f1f2ba5c893326aac7cf115c97b83a6a69cdf0 (patch)
tree3599de411e243325f74e35d2d7c55aad1018aef5 /gnu/llvm
parent1d6bade28f3f48bfd26520874210b59fccc5dbeb (diff)
Import LLVM 5.0.1 release including clang, lld and lldb.
Diffstat (limited to 'gnu/llvm')
-rw-r--r--gnu/llvm/tools/clang/bindings/python/tests/cindex/test_exception_specification_kind.py32
1 files changed, 12 insertions, 20 deletions
diff --git a/gnu/llvm/tools/clang/bindings/python/tests/cindex/test_exception_specification_kind.py b/gnu/llvm/tools/clang/bindings/python/tests/cindex/test_exception_specification_kind.py
index 6c13f70fb25..543d47f7db9 100644
--- a/gnu/llvm/tools/clang/bindings/python/tests/cindex/test_exception_specification_kind.py
+++ b/gnu/llvm/tools/clang/bindings/python/tests/cindex/test_exception_specification_kind.py
@@ -1,14 +1,7 @@
-import os
-from clang.cindex import Config
-if 'CLANG_LIBRARY_PATH' in os.environ:
- Config.set_library_path(os.environ['CLANG_LIBRARY_PATH'])
-
import clang.cindex
from clang.cindex import ExceptionSpecificationKind
from .util import get_tu
-import unittest
-
def find_function_declarations(node, declarations=[]):
if node.kind == clang.cindex.CursorKind.FUNCTION_DECL:
@@ -18,18 +11,17 @@ def find_function_declarations(node, declarations=[]):
return declarations
-class TestExceptionSpecificationKind(unittest.TestCase):
- def test_exception_specification_kind(self):
- source = """int square1(int x);
- int square2(int x) noexcept;
- int square3(int x) noexcept(noexcept(x * x));"""
+def test_exception_specification_kind():
+ source = """int square1(int x);
+ int square2(int x) noexcept;
+ int square3(int x) noexcept(noexcept(x * x));"""
- tu = get_tu(source, lang='cpp', flags=['-std=c++14'])
+ tu = get_tu(source, lang='cpp', flags=['-std=c++14'])
- declarations = find_function_declarations(tu.cursor)
- expected = [
- ('square1', ExceptionSpecificationKind.NONE),
- ('square2', ExceptionSpecificationKind.BASIC_NOEXCEPT),
- ('square3', ExceptionSpecificationKind.COMPUTED_NOEXCEPT)
- ]
- self.assertListEqual(declarations, expected)
+ declarations = find_function_declarations(tu.cursor)
+ expected = [
+ ('square1', ExceptionSpecificationKind.NONE),
+ ('square2', ExceptionSpecificationKind.BASIC_NOEXCEPT),
+ ('square3', ExceptionSpecificationKind.COMPUTED_NOEXCEPT)
+ ]
+ assert declarations == expected