[PATCH] D39763: [clang] [python] [tests] Rewrite to use standard unittest module

Michał Górny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 7 15:07:32 PST 2017


mgorny added a comment.

Before:

  ======================================================================
  FAIL: tests.cindex.test_code_completion.test_code_complete_availability
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/usr/lib64/python2.7/site-packages/nose/case.py", line 197, in runTest
      self.test(*self.arg)
    File "/usr/src/llvm/tools/clang/bindings/python/tests/cindex/test_code_completion.py", line 75, in test_code_complete_availability
      check_completion_results(cr, expected)
    File "/usr/src/llvm/tools/clang/bindings/python/tests/cindex/test_code_completion.py", line 10, in check_completion_results
      assert c in completions
  AssertionError
  
  ======================================================================
  FAIL: Ensure that linkage specifers are available on cursors
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/usr/lib64/python2.7/site-packages/nose/case.py", line 197, in runTest
      self.test(*self.arg)
    File "/usr/src/llvm/tools/clang/bindings/python/tests/cindex/test_linkage.py", line 26, in test_linkage
      assert unique_external.linkage == LinkageKind.UNIQUE_EXTERNAL
  AssertionError
  
  ======================================================================
  FAIL: Ensure that thread-local storage kinds are available on cursors.
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/usr/lib64/python2.7/site-packages/nose/case.py", line 197, in runTest
      self.test(*self.arg)
    File "/usr/src/llvm/tools/clang/bindings/python/tests/cindex/test_tls_kind.py", line 36, in test_tls_kind
      assert tls_declspec.tls_kind == TLSKind.STATIC
  AssertionError
  
  ----------------------------------------------------------------------
  Ran 117 tests in 1.460s
  
  FAILED (failures=3)

After:

  ======================================================================
  FAIL: test_code_complete_availability (tests.cindex.test_code_completion.TestCodeCompletion)
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/usr/src/llvm/tools/clang/bindings/python/tests/cindex/test_code_completion.py", line 79, in test_code_complete_availability
      self.check_completion_results(cr, expected)
    File "/usr/src/llvm/tools/clang/bindings/python/tests/cindex/test_code_completion.py", line 14, in check_completion_results
      self.assertIn(c, completions)
  AssertionError: "{'P &', ResultType} | {'operator=', TypedText} | {'(', LeftParen} | {'const P &', Placeholder} | {')', RightParen} || Priority: 34 || Availability: Available || Brief comment: None" not found in ["{'void', ResultType} | {'~P', TypedText} | {'(', LeftParen} | {')', RightParen} || Priority: 79 || Availability: Available || Brief comment: None", "{'P &', ResultType} | {'operator=', TypedText} | {'(', LeftParen} | {'const P &', Placeholder} | {')', RightParen} || Priority: 79 || Availability: Available || Brief comment: None", "{'P', TypedText} | {'::', Text} || Priority: 75 || Availability: Available || Brief comment: None", "{'int', ResultType} | {'member', TypedText} || Priority: 35 || Availability: NotAccessible || Brief comment: None"]
  
  ======================================================================
  FAIL: Ensure that linkage specifers are available on cursors
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/usr/src/llvm/tools/clang/bindings/python/tests/cindex/test_linkage.py", line 29, in test_linkage
      self.assertEqual(unique_external.linkage, LinkageKind.UNIQUE_EXTERNAL)
  AssertionError: LinkageKind.INTERNAL != LinkageKind.UNIQUE_EXTERNAL
  
  ======================================================================
  FAIL: Ensure that thread-local storage kinds are available on cursors.
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/usr/src/llvm/tools/clang/bindings/python/tests/cindex/test_tls_kind.py", line 39, in test_tls_kind
      self.assertEqual(tls_declspec.tls_kind, TLSKind.STATIC)
  AssertionError: TLSKind.DYNAMIC != TLSKind.STATIC
  
  ----------------------------------------------------------------------
  Ran 117 tests in 1.471s
  
  FAILED (failures=3)


Repository:
  rL LLVM

https://reviews.llvm.org/D39763





More information about the cfe-commits mailing list