Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[clang][python][test] Move python binding tests to lit framework#148802

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
DeinAlptraum merged 1 commit intollvm:mainfromDeinAlptraum:movelit2
Jul 15, 2025

Conversation

DeinAlptraum
Copy link
Contributor

As discussed in PR#142353, the current testsuite of theclang Python bindings has several issues:

  • Itlibclang.so cannot be loaded intopython to run the testsuite, the wholeninja check-all aborts.
  • The result of running the testsuite isn't report like thelit-based tests, rendering them almost invisible.
  • The testsuite is disabled in a non-obvious way (RUN_PYTHON_TESTS) intests/CMakeLists.txt, which again doesn't show up in the test results.

All these issues can be avoided by integrating the Python bindings tests withlit, which is what this patch does:

  • The actual test lives inclang/test/bindings/python/bindings.sh and is run bylit.
  • The currentclang/bindings/python/tests directory (minus the now-subperfluousCMakeLists.txt) is moved into the same directory.
  • The check iflibclang is loadable (originally from PR[clang][python][test] Check if libclang.so is loadable #142353) is now handled via a newlit feature,libclang-loadable.
  • The various ways to disable the tests have been turned intoXFAILs as appropriate. This isn't complete and not completely tested yet.

Tested onsparc-sun-solaris2.11,sparcv9-sun-solaris2.11,i386-pc-solaris2.11,amd64-pc-solaris2.11,i686-pc-linux-gnu, andx86_64-pc-linux-gnu.

As discussed in PRllvm#142353, the current testsuite of the `clang` Pythonbindings has several issues:- It `libclang.so` cannot be loaded into `python` to run the testsuite, the  whole `ninja check-all` aborts.- The result of running the testsuite isn't report like the `lit`-based  tests, rendering them almost invisible.- The testsuite is disabled in a non-obvious way (`RUN_PYTHON_TESTS`) in  `tests/CMakeLists.txt`, which again doesn't show up in the test results.All these issues can be avoided by integrating the Python bindings testswith `lit`, which is what this patch does:- The actual test lives in `clang/test/bindings/python/bindings.sh` and is  run by `lit`.- The current `clang/bindings/python/tests` directory (minus the  now-subperfluous `CMakeLists.txt`) is moved into the same directory.- The check if `libclang` is loadable (originally from PRllvm#142353) is now  handled via a new `lit` feature, `libclang-loadable`.- The various ways to disable the tests have been turned into `XFAIL`s as  appropriate.  This isn't complete and not completely tested yet.Tested on `sparc-sun-solaris2.11`, `sparcv9-sun-solaris2.11`,`i386-pc-solaris2.11`, `amd64-pc-solaris2.11`, `i686-pc-linux-gnu`, and`x86_64-pc-linux-gnu`.
@llvmbotllvmbot added clangClang issues not falling into any other category clang:as-a-librarylibclang and C++ API github:workflow labelsJul 15, 2025
@llvmbot
Copy link
Member

llvmbot commentedJul 15, 2025
edited
Loading

@llvm/pr-subscribers-github-workflow

@llvm/pr-subscribers-clang

Author: Jannick Kremer (DeinAlptraum)

Changes

As discussed in PR #142353, the current testsuite of theclang Python bindings has several issues:

  • Itlibclang.so cannot be loaded intopython to run the testsuite, the wholeninja check-all aborts.
  • The result of running the testsuite isn't report like thelit-based tests, rendering them almost invisible.
  • The testsuite is disabled in a non-obvious way (RUN_PYTHON_TESTS) intests/CMakeLists.txt, which again doesn't show up in the test results.

All these issues can be avoided by integrating the Python bindings tests withlit, which is what this patch does:

  • The actual test lives inclang/test/bindings/python/bindings.sh and is run bylit.
  • The currentclang/bindings/python/tests directory (minus the now-subperfluousCMakeLists.txt) is moved into the same directory.
  • The check iflibclang is loadable (originally from PR #142353) is now handled via a newlit feature,libclang-loadable.
  • The various ways to disable the tests have been turned intoXFAILs as appropriate. This isn't complete and not completely tested yet.

Tested onsparc-sun-solaris2.11,sparcv9-sun-solaris2.11,i386-pc-solaris2.11,amd64-pc-solaris2.11,i686-pc-linux-gnu, andx86_64-pc-linux-gnu.


Full diff:https://github.com/llvm/llvm-project/pull/148802.diff

40 Files Affected:

  • (modified) .github/workflows/libclang-python-tests.yml (+2-2)
  • (modified) clang/CMakeLists.txt (-1)
  • (removed) clang/bindings/python/tests/CMakeLists.txt (-66)
  • (modified) clang/test/CMakeLists.txt (+11)
  • (added) clang/test/bindings/python/bindings.sh (+38)
  • (added) clang/test/bindings/python/lit.local.cfg (+41)
  • (renamed) clang/test/bindings/python/tests/init.py ()
  • (renamed) clang/test/bindings/python/tests/cindex/INPUTS/a.inc ()
  • (renamed) clang/test/bindings/python/tests/cindex/INPUTS/b.inc ()
  • (renamed) clang/test/bindings/python/tests/cindex/INPUTS/compile_commands.json ()
  • (renamed) clang/test/bindings/python/tests/cindex/INPUTS/header1.h ()
  • (renamed) clang/test/bindings/python/tests/cindex/INPUTS/header2.h ()
  • (renamed) clang/test/bindings/python/tests/cindex/INPUTS/header3.h ()
  • (renamed) clang/test/bindings/python/tests/cindex/INPUTS/hello.cpp ()
  • (renamed) clang/test/bindings/python/tests/cindex/INPUTS/include.cpp ()
  • (renamed) clang/test/bindings/python/tests/cindex/INPUTS/parse_arguments.c ()
  • (renamed) clang/test/bindings/python/tests/cindex/INPUTS/testfile.c ()
  • (renamed) clang/test/bindings/python/tests/cindex/init.py ()
  • (renamed) clang/test/bindings/python/tests/cindex/test_access_specifiers.py ()
  • (renamed) clang/test/bindings/python/tests/cindex/test_cdb.py ()
  • (renamed) clang/test/bindings/python/tests/cindex/test_code_completion.py ()
  • (renamed) clang/test/bindings/python/tests/cindex/test_comment.py ()
  • (renamed) clang/test/bindings/python/tests/cindex/test_cursor.py ()
  • (renamed) clang/test/bindings/python/tests/cindex/test_cursor_kind.py ()
  • (renamed) clang/test/bindings/python/tests/cindex/test_diagnostics.py ()
  • (renamed) clang/test/bindings/python/tests/cindex/test_enums.py ()
  • (renamed) clang/test/bindings/python/tests/cindex/test_exception_specification_kind.py ()
  • (renamed) clang/test/bindings/python/tests/cindex/test_file.py ()
  • (renamed) clang/test/bindings/python/tests/cindex/test_index.py ()
  • (renamed) clang/test/bindings/python/tests/cindex/test_lib.py ()
  • (renamed) clang/test/bindings/python/tests/cindex/test_linkage.py ()
  • (renamed) clang/test/bindings/python/tests/cindex/test_location.py ()
  • (renamed) clang/test/bindings/python/tests/cindex/test_rewrite.py ()
  • (renamed) clang/test/bindings/python/tests/cindex/test_source_range.py ()
  • (renamed) clang/test/bindings/python/tests/cindex/test_tls_kind.py ()
  • (renamed) clang/test/bindings/python/tests/cindex/test_token_kind.py ()
  • (renamed) clang/test/bindings/python/tests/cindex/test_tokens.py ()
  • (renamed) clang/test/bindings/python/tests/cindex/test_translation_unit.py ()
  • (renamed) clang/test/bindings/python/tests/cindex/test_type.py ()
  • (renamed) clang/test/bindings/python/tests/cindex/util.py ()
diff --git a/.github/workflows/libclang-python-tests.yml b/.github/workflows/libclang-python-tests.ymlindex 50ef4acf2feb1..43b50cec61716 100644--- a/.github/workflows/libclang-python-tests.yml+++ b/.github/workflows/libclang-python-tests.yml@@ -10,15 +10,15 @@ on:       - 'main'     paths:       - 'clang/bindings/python/**'+      - 'clang/test/bindings/python/**'       - 'clang/tools/libclang/**'-      - 'clang/CMakeList.txt'       - '.github/workflows/libclang-python-tests.yml'       - '.github/workflows/llvm-project-tests.yml'   pull_request:     paths:       - 'clang/bindings/python/**'+      - 'clang/test/bindings/python/**'       - 'clang/tools/libclang/**'-      - 'clang/CMakeList.txt'       - '.github/workflows/libclang-python-tests.yml'       - '.github/workflows/llvm-project-tests.yml'diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txtindex 94607a8e8473c..72386132bce9f 100644--- a/clang/CMakeLists.txt+++ b/clang/CMakeLists.txt@@ -530,7 +530,6 @@ if( CLANG_INCLUDE_TESTS )     clang_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/test/Unit/lit.site.cfg   )   add_subdirectory(test)-  add_subdirectory(bindings/python/tests)    if(CLANG_BUILT_STANDALONE)     umbrella_lit_testsuite_end(check-all)diff --git a/clang/bindings/python/tests/CMakeLists.txt b/clang/bindings/python/tests/CMakeLists.txtdeleted file mode 100644index a0ddabc21bb41..0000000000000--- a/clang/bindings/python/tests/CMakeLists.txt+++ /dev/null@@ -1,66 +0,0 @@-# Test target to run Python test suite from main build.--# Avoid configurations including '-include' from interfering with-# our tests by setting CLANG_NO_DEFAULT_CONFIG.-add_custom_target(check-clang-python-    COMMAND ${CMAKE_COMMAND} -E env-            CLANG_NO_DEFAULT_CONFIG=1-            CLANG_LIBRARY_PATH=$<TARGET_FILE_DIR:libclang>-            "${Python3_EXECUTABLE}" -m unittest discover-    DEPENDS libclang-    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..)--set(RUN_PYTHON_TESTS TRUE)-set_target_properties(check-clang-python PROPERTIES FOLDER "Clang/Tests")--# Tests require libclang.so which is only built with LLVM_ENABLE_PIC=ON-if(NOT LLVM_ENABLE_PIC)-  set(RUN_PYTHON_TESTS FALSE)-endif()--# Do not try to run if libclang was built with sanitizers because-# the sanitizer library will likely be loaded too late to perform-# interception and will then fail.-# We could use LD_PRELOAD/DYLD_INSERT_LIBRARIES but this isn't-# portable so its easier just to not run the tests when building-# with ASan.-if(NOT LLVM_USE_SANITIZER STREQUAL "")-  set(RUN_PYTHON_TESTS FALSE)-endif()--# Tests fail on Windows, and need someone knowledgeable to fix.-# It's not clear whether it's a test or a valid binding problem.-if(WIN32)-  set(RUN_PYTHON_TESTS FALSE)-endif()--# The Python FFI interface is broken on AIX: https://bugs.python.org/issue38628.-if(${CMAKE_SYSTEM_NAME} MATCHES "AIX")-  set(RUN_PYTHON_TESTS FALSE)-endif()--# AArch64, Hexagon, and Sparc have known test failures that need to be-# addressed.-# SystemZ has broken Python/FFI interface:-# https://reviews.llvm.org/D52840#1265716-if(${LLVM_NATIVE_ARCH} MATCHES "^(AArch64|Hexagon|Sparc|SystemZ)$")-  set(RUN_PYTHON_TESTS FALSE)-endif()--# Tests will fail if cross-compiling for a different target, as tests will try-# to use the host Python3_EXECUTABLE and make FFI calls to functions in target-# libraries.-if(CMAKE_CROSSCOMPILING)-  # FIXME: Consider a solution that allows better control over these tests in-  # a crosscompiling scenario. e.g. registering them with lit to allow them to-  # be explicitly skipped via appropriate LIT_ARGS, or adding a mechanism to-  # allow specifying a python interpreter compiled for the target that could-  # be executed using qemu-user.-  message(WARNING "check-clang-python not added to check-all as these tests fail in a cross-build setup")-  set(RUN_PYTHON_TESTS FALSE)-endif()--if(RUN_PYTHON_TESTS)-    set_property(GLOBAL APPEND PROPERTY-                 LLVM_ALL_ADDITIONAL_TEST_TARGETS check-clang-python)-endif()diff --git a/clang/test/CMakeLists.txt b/clang/test/CMakeLists.txtindex e5b4a3bb84645..a9b88d4f4d9ec 100644--- a/clang/test/CMakeLists.txt+++ b/clang/test/CMakeLists.txt@@ -205,6 +205,17 @@ add_custom_target(clang-test) add_dependencies(clang-test check-clang) set_target_properties(clang-test PROPERTIES FOLDER "Clang/Tests")+# Allow running Clang Python binding tests separately from CI.+add_lit_testsuite(check-clang-python "Running the Clang Python tests"+  ${CMAKE_CURRENT_BINARY_DIR}+  #LIT ${LLVM_LIT}+  PARAMS ${CLANG_TEST_PARAMS}+  DEPENDS ${CLANG_TEST_DEPS}+  ARGS ${CLANG_TEST_EXTRA_ARGS} --filter=bindings.sh+  # Avoid running tests twice.+  EXCLUDE_FROM_CHECK_ALL+  )+ # FIXME: This logic can be removed once all buildbots have moved # debuginfo-test from clang/test to llvm/projects or monorepo. if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/debuginfo-tests)diff --git a/clang/test/bindings/python/bindings.sh b/clang/test/bindings/python/bindings.shnew file mode 100755index 0000000000000..3f7a51ef9ca49--- /dev/null+++ b/clang/test/bindings/python/bindings.sh@@ -0,0 +1,38 @@+#!/bin/sh++# UNSUPPORTED: !libclang-loadable++# Tests fail on Windows, and need someone knowledgeable to fix.+# It's not clear whether it's a test or a valid binding problem.+# XFAIL: target={{.*windows.*}}++# The Python FFI interface is broken on AIX: https://bugs.python.org/issue38628.+# XFAIL: target={{.*-aix.*}}++# Hexagon has known test failures that need to be addressed.+# https://reviews.llvm.org/D52840#1265716+# XFAIL: target={{hexagon-.*}}+# python SEGVs on Linux/sparc64 when loading libclang.so.  Seems to be an FFI+# issue, too.+# XFAIL: target={{sparc.*-.*-linux.*}}++# Tests will fail if cross-compiling for a different target, as tests will try+# to use the host Python3_EXECUTABLE and make FFI calls to functions in target+# libraries.+#+# FIXME: Consider a solution that allows better control over these tests in+# a crosscompiling scenario. e.g. registering them with lit to allow them to+# be explicitly skipped via appropriate LIT_ARGS, or adding a mechanism to+# allow specifying a python interpreter compiled for the target that could+# be executed using qemu-user.+# REQUIRES: native++# SystemZ has broken Python/FFI interface+# according to https://reviews.llvm.org/D52840#1265716+# This leads to failures only when Clang is built with GCC apparently, see:+# https://github.com/llvm/llvm-project/pull/146844#issuecomment-3048291798+# REQUIRES: !target={{s390x-.*}}++# RUN: env PYTHONPATH=%S/../../../bindings/python \+# RUN:   CLANG_LIBRARY_PATH=%libdir \+# RUN:   %python -m unittest discover -s %S/testsdiff --git a/clang/test/bindings/python/lit.local.cfg b/clang/test/bindings/python/lit.local.cfgnew file mode 100644index 0000000000000..cc3bdf8ba97d4--- /dev/null+++ b/clang/test/bindings/python/lit.local.cfg@@ -0,0 +1,41 @@+def is_libclang_loadable():+    # Do not try to run if libclang was built with sanitizers because+    # the sanitizer library will likely be loaded too late to perform+    # interception and will then fail.+    # We could use LD_PRELOAD/DYLD_INSERT_LIBRARIES but this isn't+    # portable so its easier just to not run the tests when building+    # with ASan.+    if config.llvm_use_sanitizer != "":+        return False+    try:+        sys.path.append(os.path.join(config.clang_src_dir, "bindings/python"))+        from clang.cindex import Config+        conf = Config()+        Config.set_library_path(config.clang_lib_dir)+        conf.lib+        return True+    except Exception as e:+        # Expected failure modes are considered benign when nothing can be+        # done about them.+        #+        # Cannot load a 32-bit libclang.so into a 64-bit python.+        if "wrong ELF class: ELFCLASS32" in str(e):+            return False+        # If libclang.so is missing, it must have been disabled intentionally,+        # e.g. by building with LLVM_ENABLE_PIC=OFF.+        elif "No such file or directory" in str(e):+            return False+        # Unexpected failure modes need to be investigated to either fix an+        # underlying bug or accept the failure, so return True.  This causes+        # tests to run and FAIL, drawing developer attention.+        else:+            print("warning: unhandled failure in is_libclang_loadable: "+                  + str(e), file=sys.stderr)+            return True++if is_libclang_loadable():+    config.available_features.add("libclang-loadable")++config.substitutions.append(('%libdir', config.clang_lib_dir))++config.suffixes = ['.sh']diff --git a/clang/bindings/python/tests/__init__.py b/clang/test/bindings/python/tests/__init__.pysimilarity index 100%rename from clang/bindings/python/tests/__init__.pyrename to clang/test/bindings/python/tests/__init__.pydiff --git a/clang/bindings/python/tests/cindex/INPUTS/a.inc b/clang/test/bindings/python/tests/cindex/INPUTS/a.incsimilarity index 100%rename from clang/bindings/python/tests/cindex/INPUTS/a.increname to clang/test/bindings/python/tests/cindex/INPUTS/a.incdiff --git a/clang/bindings/python/tests/cindex/INPUTS/b.inc b/clang/test/bindings/python/tests/cindex/INPUTS/b.incsimilarity index 100%rename from clang/bindings/python/tests/cindex/INPUTS/b.increname to clang/test/bindings/python/tests/cindex/INPUTS/b.incdiff --git a/clang/bindings/python/tests/cindex/INPUTS/compile_commands.json b/clang/test/bindings/python/tests/cindex/INPUTS/compile_commands.jsonsimilarity index 100%rename from clang/bindings/python/tests/cindex/INPUTS/compile_commands.jsonrename to clang/test/bindings/python/tests/cindex/INPUTS/compile_commands.jsondiff --git a/clang/bindings/python/tests/cindex/INPUTS/header1.h b/clang/test/bindings/python/tests/cindex/INPUTS/header1.hsimilarity index 100%rename from clang/bindings/python/tests/cindex/INPUTS/header1.hrename to clang/test/bindings/python/tests/cindex/INPUTS/header1.hdiff --git a/clang/bindings/python/tests/cindex/INPUTS/header2.h b/clang/test/bindings/python/tests/cindex/INPUTS/header2.hsimilarity index 100%rename from clang/bindings/python/tests/cindex/INPUTS/header2.hrename to clang/test/bindings/python/tests/cindex/INPUTS/header2.hdiff --git a/clang/bindings/python/tests/cindex/INPUTS/header3.h b/clang/test/bindings/python/tests/cindex/INPUTS/header3.hsimilarity index 100%rename from clang/bindings/python/tests/cindex/INPUTS/header3.hrename to clang/test/bindings/python/tests/cindex/INPUTS/header3.hdiff --git a/clang/bindings/python/tests/cindex/INPUTS/hello.cpp b/clang/test/bindings/python/tests/cindex/INPUTS/hello.cppsimilarity index 100%rename from clang/bindings/python/tests/cindex/INPUTS/hello.cpprename to clang/test/bindings/python/tests/cindex/INPUTS/hello.cppdiff --git a/clang/bindings/python/tests/cindex/INPUTS/include.cpp b/clang/test/bindings/python/tests/cindex/INPUTS/include.cppsimilarity index 100%rename from clang/bindings/python/tests/cindex/INPUTS/include.cpprename to clang/test/bindings/python/tests/cindex/INPUTS/include.cppdiff --git a/clang/bindings/python/tests/cindex/INPUTS/parse_arguments.c b/clang/test/bindings/python/tests/cindex/INPUTS/parse_arguments.csimilarity index 100%rename from clang/bindings/python/tests/cindex/INPUTS/parse_arguments.crename to clang/test/bindings/python/tests/cindex/INPUTS/parse_arguments.cdiff --git a/clang/bindings/python/tests/cindex/INPUTS/testfile.c b/clang/test/bindings/python/tests/cindex/INPUTS/testfile.csimilarity index 100%rename from clang/bindings/python/tests/cindex/INPUTS/testfile.crename to clang/test/bindings/python/tests/cindex/INPUTS/testfile.cdiff --git a/clang/bindings/python/tests/cindex/__init__.py b/clang/test/bindings/python/tests/cindex/__init__.pysimilarity index 100%rename from clang/bindings/python/tests/cindex/__init__.pyrename to clang/test/bindings/python/tests/cindex/__init__.pydiff --git a/clang/bindings/python/tests/cindex/test_access_specifiers.py b/clang/test/bindings/python/tests/cindex/test_access_specifiers.pysimilarity index 100%rename from clang/bindings/python/tests/cindex/test_access_specifiers.pyrename to clang/test/bindings/python/tests/cindex/test_access_specifiers.pydiff --git a/clang/bindings/python/tests/cindex/test_cdb.py b/clang/test/bindings/python/tests/cindex/test_cdb.pysimilarity index 100%rename from clang/bindings/python/tests/cindex/test_cdb.pyrename to clang/test/bindings/python/tests/cindex/test_cdb.pydiff --git a/clang/bindings/python/tests/cindex/test_code_completion.py b/clang/test/bindings/python/tests/cindex/test_code_completion.pysimilarity index 100%rename from clang/bindings/python/tests/cindex/test_code_completion.pyrename to clang/test/bindings/python/tests/cindex/test_code_completion.pydiff --git a/clang/bindings/python/tests/cindex/test_comment.py b/clang/test/bindings/python/tests/cindex/test_comment.pysimilarity index 100%rename from clang/bindings/python/tests/cindex/test_comment.pyrename to clang/test/bindings/python/tests/cindex/test_comment.pydiff --git a/clang/bindings/python/tests/cindex/test_cursor.py b/clang/test/bindings/python/tests/cindex/test_cursor.pysimilarity index 100%rename from clang/bindings/python/tests/cindex/test_cursor.pyrename to clang/test/bindings/python/tests/cindex/test_cursor.pydiff --git a/clang/bindings/python/tests/cindex/test_cursor_kind.py b/clang/test/bindings/python/tests/cindex/test_cursor_kind.pysimilarity index 100%rename from clang/bindings/python/tests/cindex/test_cursor_kind.pyrename to clang/test/bindings/python/tests/cindex/test_cursor_kind.pydiff --git a/clang/bindings/python/tests/cindex/test_diagnostics.py b/clang/test/bindings/python/tests/cindex/test_diagnostics.pysimilarity index 100%rename from clang/bindings/python/tests/cindex/test_diagnostics.pyrename to clang/test/bindings/python/tests/cindex/test_diagnostics.pydiff --git a/clang/bindings/python/tests/cindex/test_enums.py b/clang/test/bindings/python/tests/cindex/test_enums.pysimilarity index 100%rename from clang/bindings/python/tests/cindex/test_enums.pyrename to clang/test/bindings/python/tests/cindex/test_enums.pydiff --git a/clang/bindings/python/tests/cindex/test_exception_specification_kind.py b/clang/test/bindings/python/tests/cindex/test_exception_specification_kind.pysimilarity index 100%rename from clang/bindings/python/tests/cindex/test_exception_specification_kind.pyrename to clang/test/bindings/python/tests/cindex/test_exception_specification_kind.pydiff --git a/clang/bindings/python/tests/cindex/test_file.py b/clang/test/bindings/python/tests/cindex/test_file.pysimilarity index 100%rename from clang/bindings/python/tests/cindex/test_file.pyrename to clang/test/bindings/python/tests/cindex/test_file.pydiff --git a/clang/bindings/python/tests/cindex/test_index.py b/clang/test/bindings/python/tests/cindex/test_index.pysimilarity index 100%rename from clang/bindings/python/tests/cindex/test_index.pyrename to clang/test/bindings/python/tests/cindex/test_index.pydiff --git a/clang/bindings/python/tests/cindex/test_lib.py b/clang/test/bindings/python/tests/cindex/test_lib.pysimilarity index 100%rename from clang/bindings/python/tests/cindex/test_lib.pyrename to clang/test/bindings/python/tests/cindex/test_lib.pydiff --git a/clang/bindings/python/tests/cindex/test_linkage.py b/clang/test/bindings/python/tests/cindex/test_linkage.pysimilarity index 100%rename from clang/bindings/python/tests/cindex/test_linkage.pyrename to clang/test/bindings/python/tests/cindex/test_linkage.pydiff --git a/clang/bindings/python/tests/cindex/test_location.py b/clang/test/bindings/python/tests/cindex/test_location.pysimilarity index 100%rename from clang/bindings/python/tests/cindex/test_location.pyrename to clang/test/bindings/python/tests/cindex/test_location.pydiff --git a/clang/bindings/python/tests/cindex/test_rewrite.py b/clang/test/bindings/python/tests/cindex/test_rewrite.pysimilarity index 100%rename from clang/bindings/python/tests/cindex/test_rewrite.pyrename to clang/test/bindings/python/tests/cindex/test_rewrite.pydiff --git a/clang/bindings/python/tests/cindex/test_source_range.py b/clang/test/bindings/python/tests/cindex/test_source_range.pysimilarity index 100%rename from clang/bindings/python/tests/cindex/test_source_range.pyrename to clang/test/bindings/python/tests/cindex/test_source_range.pydiff --git a/clang/bindings/python/tests/cindex/test_tls_kind.py b/clang/test/bindings/python/tests/cindex/test_tls_kind.pysimilarity index 100%rename from clang/bindings/python/tests/cindex/test_tls_kind.pyrename to clang/test/bindings/python/tests/cindex/test_tls_kind.pydiff --git a/clang/bindings/python/tests/cindex/test_token_kind.py b/clang/test/bindings/python/tests/cindex/test_token_kind.pysimilarity index 100%rename from clang/bindings/python/tests/cindex/test_token_kind.pyrename to clang/test/bindings/python/tests/cindex/test_token_kind.pydiff --git a/clang/bindings/python/tests/cindex/test_tokens.py b/clang/test/bindings/python/tests/cindex/test_tokens.pysimilarity index 100%rename from clang/bindings/python/tests/cindex/test_tokens.pyrename to clang/test/bindings/python/tests/cindex/test_tokens.pydiff --git a/clang/bindings/python/tests/cindex/test_translation_unit.py b/clang/test/bindings/python/tests/cindex/test_translation_unit.pysimilarity index 100%rename from clang/bindings/python/tests/cindex/test_translation_unit.pyrename to clang/test/bindings/python/tests/cindex/test_translation_unit.pydiff --git a/clang/bindings/python/tests/cindex/test_type.py b/clang/test/bindings/python/tests/cindex/test_type.pysimilarity index 100%rename from clang/bindings/python/tests/cindex/test_type.pyrename to clang/test/bindings/python/tests/cindex/test_type.pydiff --git a/clang/bindings/python/tests/cindex/util.py b/clang/test/bindings/python/tests/cindex/util.pysimilarity index 100%rename from clang/bindings/python/tests/cindex/util.pyrename to clang/test/bindings/python/tests/cindex/util.py

@DeinAlptraum
Copy link
ContributorAuthor

Next attempt after#146844.
The only change is, that I added aUNSUPPORTED directive for s390x after the discussion on that PR. (see comment#146844 (comment))

@DeinAlptraumDeinAlptraum merged commitec149d5 intollvm:mainJul 15, 2025
15 checks passed
@DeinAlptraumDeinAlptraum deleted the movelit2 branchJuly 15, 2025 10:48
@ZequanWu
Copy link
Contributor

ZequanWu commentedJul 15, 2025
edited
Loading

Hi, it might be the cause of a test failure on our arm macos bot:

 ====================================================================== ERROR: test_typekind_spelling (cindex.test_type.TestType) Ensure TypeKind.spelling works. ---------------------------------------------------------------------- Traceback (most recent call last):   File "/Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm/clang/bindings/python/clang/cindex.py", line 4370, in get_cindex_library     library = cdll.LoadLibrary(self.get_filename())   File "/Volumes/Work/s/w/ir/cache/osx_sdk/XCode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/ctypes/__init__.py", line 444, in LoadLibrary     return self._dlltype(name)   File "/Volumes/Work/s/w/ir/cache/osx_sdk/XCode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/ctypes/__init__.py", line 366, in __init__     self._handle = _dlopen(self._name, mode) OSError: dlopen(/Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-bootstrap/lib/libclang.dylib, 0x0006): tried: '/Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-bootstrap/lib/libclang.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-bootstrap/lib/libclang.dylib' (no such file), '/Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-bootstrap/lib/libclang.dylib' (no such file)  During handling of the above exception, another exception occurred:  Traceback (most recent call last):   File "/Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm/clang/test/bindings/python/tests/cindex/test_type.py", line 194, in test_typekind_spelling     tu = get_tu("int a;")   File "/Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm/clang/test/bindings/python/tests/cindex/util.py", line 30, in get_tu     return TranslationUnit.from_source(name, args, unsaved_files=[(name, source)])   File "/Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm/clang/bindings/python/clang/cindex.py", line 3316, in from_source     index = Index.create()   File "/Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm/clang/bindings/python/clang/cindex.py", line 3188, in create     return Index(conf.lib.clang_createIndex(excludeDecls, 0))   File "/Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm/clang/bindings/python/clang/cindex.py", line 250, in __get__     value = self.wrapped(instance)   File "/Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm/clang/bindings/python/clang/cindex.py", line 4342, in lib     lib = self.get_cindex_library()   File "/Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm/clang/bindings/python/clang/cindex.py", line 4377, in get_cindex_library     raise LibclangError(msg) clang.cindex.LibclangError: dlopen(/Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-bootstrap/lib/libclang.dylib, 0x0006): tried: '/Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-bootstrap/lib/libclang.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-bootstrap/lib/libclang.dylib' (no such file), '/Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-bootstrap/lib/libclang.dylib' (no such file). To provide a path to libclang use Config.set_library_path() or Config.set_library_file().  ---------------------------------------------------------------------- Ran 165 tests in 0.064s  FAILED (errors=157)

@DeinAlptraum
Copy link
ContributorAuthor

@ZequanWu thanks for the report!
Reverted in#149012 for now

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
clang:as-a-librarylibclang and C++ APIclangClang issues not falling into any other categorygithub:workflow
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@DeinAlptraum@llvmbot@ZequanWu@rorth

[8]ページ先頭

©2009-2025 Movatter.jp