[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-04-24 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum closed https://github.com/llvm/llvm-project/pull/130383 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-04-24 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/130383 >From 1e6ed0266fb849f14d6b952dcd84e277ed70aa58 Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Thu, 19 Dec 2024 16:22:04 +0100 Subject: [PATCH 01/12] [libclang/python] Add equality comparison operators

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-04-24 Thread Vlad Serebrennikov via cfe-commits
@@ -0,0 +1 @@ +1, 2, 3 Endilll wrote: Lack of newline at the end of the file doesn't seem to be an important part of the test. You should add it to both `a.inc` and `b.inc` https://github.com/llvm/llvm-project/pull/130383 ___

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-04-24 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll approved this pull request. https://github.com/llvm/llvm-project/pull/130383 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-04-23 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: @Endilll having merged #135773 and rebased, the issues with file equality for in-memory files are resolved. I've reduced this to two tests now, that run on the except same C code except one of them uses on-disk files and the other one uses in-memory files. This replicates

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-04-23 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/130383 >From 1e6ed0266fb849f14d6b952dcd84e277ed70aa58 Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Thu, 19 Dec 2024 16:22:04 +0100 Subject: [PATCH 01/11] [libclang/python] Add equality comparison operators

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-04-23 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/130383 >From 1e6ed0266fb849f14d6b952dcd84e277ed70aa58 Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Thu, 19 Dec 2024 16:22:04 +0100 Subject: [PATCH 01/10] [libclang/python] Add equality comparison operators

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-04-15 Thread Jannick Kremer via cfe-commits
@@ -16,3 +17,76 @@ def test_file(self): self.assertEqual(str(file), "t.c") self.assertEqual(file.name, "t.c") self.assertEqual(repr(file), "") + +def test_file_eq(self): +path = os.path.join(inputs_dir, "hello.cpp") +header_path = os.

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-04-09 Thread Jannick Kremer via cfe-commits
@@ -16,3 +17,76 @@ def test_file(self): self.assertEqual(str(file), "t.c") self.assertEqual(file.name, "t.c") self.assertEqual(repr(file), "") + +def test_file_eq(self): +path = os.path.join(inputs_dir, "hello.cpp") +header_path = os.

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-04-04 Thread Vlad Serebrennikov via cfe-commits
@@ -444,6 +444,7 @@ Python Binding Changes -- - Added ``Type.get_methods``, a binding for ``clang_visitCXXMethods``, which allows visiting the methods of a class. +- Add equality comparison operators for ``File`` type Endilll wrote: ```su

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-26 Thread Aaron Ballman via cfe-commits
@@ -16,3 +17,76 @@ def test_file(self): self.assertEqual(str(file), "t.c") self.assertEqual(file.name, "t.c") self.assertEqual(repr(file), "") + +def test_file_eq(self): +path = os.path.join(inputs_dir, "hello.cpp") +header_path = os.

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-24 Thread Jannick Kremer via cfe-commits
@@ -16,3 +17,76 @@ def test_file(self): self.assertEqual(str(file), "t.c") self.assertEqual(file.name, "t.c") self.assertEqual(repr(file), "") + +def test_file_eq(self): +path = os.path.join(inputs_dir, "hello.cpp") +header_path = os.

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-24 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > @AaronBallman do you have a clue why equality comparison for in-memory files > works differently compared to on-disk files? Are they? I think you're supposed to use `FileSystem::equivalent()` to test for it which uses an underlying unique ID. https://github.com/llvm/llv

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-22 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/130383 >From e8bf3b6f08f0e0030ea36fe8c42fcde166ad27e3 Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Thu, 19 Dec 2024 16:22:04 +0100 Subject: [PATCH 1/9] [libclang/python] Add equality comparison operators fo

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-22 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: As for investigation: I wrote four tests in `test_file.py` that just assert all files as equal (the ones named `test_file_eq_failing...`) which is expected to fail, and all four of these tests fail for me locally. But in the CI, it seems that indeed all in-memory files seem

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-22 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/130383 >From e8bf3b6f08f0e0030ea36fe8c42fcde166ad27e3 Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Thu, 19 Dec 2024 16:22:04 +0100 Subject: [PATCH 1/8] [libclang/python] Add equality comparison operators fo

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-22 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff a27da0a20cbfb9f0c600d53bf2520f068b222f59 262f6602c76de472ddcacfe1d13069f777aaec73 --e

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-22 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/130383 >From e8bf3b6f08f0e0030ea36fe8c42fcde166ad27e3 Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Thu, 19 Dec 2024 16:22:04 +0100 Subject: [PATCH 1/7] [libclang/python] Add equality comparison operators fo

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-22 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/130383 >From e8bf3b6f08f0e0030ea36fe8c42fcde166ad27e3 Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Thu, 19 Dec 2024 16:22:04 +0100 Subject: [PATCH 1/6] [libclang/python] Add equality comparison operators fo

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-22 Thread Vlad Serebrennikov via cfe-commits
@@ -16,3 +17,30 @@ def test_file(self): self.assertEqual(str(file), "t.c") self.assertEqual(file.name, "t.c") self.assertEqual(repr(file), "") + +def test_file_eq(self): +path = os.path.join(inputs_dir, "hello.cpp") +header_path = os.

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-21 Thread Jannick Kremer via cfe-commits
@@ -16,3 +17,16 @@ def test_file(self): self.assertEqual(str(file), "t.c") self.assertEqual(file.name, "t.c") self.assertEqual(repr(file), "") + +def test_file_eq(self): +path = os.path.join(kInputsDir, "hello.cpp") +header_path = os.

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-21 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/130383 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-21 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/130383 >From e8bf3b6f08f0e0030ea36fe8c42fcde166ad27e3 Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Thu, 19 Dec 2024 16:22:04 +0100 Subject: [PATCH 1/6] [libclang/python] Add equality comparison operators fo

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-21 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/130383 >From e8bf3b6f08f0e0030ea36fe8c42fcde166ad27e3 Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Thu, 19 Dec 2024 16:22:04 +0100 Subject: [PATCH 1/6] [libclang/python] Add equality comparison operators fo

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-21 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/130383 >From e8bf3b6f08f0e0030ea36fe8c42fcde166ad27e3 Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Thu, 19 Dec 2024 16:22:04 +0100 Subject: [PATCH 1/5] [libclang/python] Add equality comparison operators fo

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-21 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: @AaronBallman do you have a clue why equality comparison for in-memory files works differently compared to on-disk files? https://github.com/llvm/llvm-project/pull/130383 ___ cfe-commits mailing list cfe-commits@l

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-21 Thread Vlad Serebrennikov via cfe-commits
@@ -16,3 +17,16 @@ def test_file(self): self.assertEqual(str(file), "t.c") self.assertEqual(file.name, "t.c") self.assertEqual(repr(file), "") + +def test_file_eq(self): +path = os.path.join(kInputsDir, "hello.cpp") +header_path = os.

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-21 Thread Vlad Serebrennikov via cfe-commits
@@ -16,3 +17,30 @@ def test_file(self): self.assertEqual(str(file), "t.c") self.assertEqual(file.name, "t.c") self.assertEqual(repr(file), "") + +def test_file_eq(self): +path = os.path.join(inputs_dir, "hello.cpp") +header_path = os.

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-21 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/130383 >From e8bf3b6f08f0e0030ea36fe8c42fcde166ad27e3 Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Thu, 19 Dec 2024 16:22:04 +0100 Subject: [PATCH 1/4] [libclang/python] Add equality comparison operators fo

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-21 Thread Jannick Kremer via cfe-commits
@@ -1,12 +1,13 @@ import os -from clang.cindex import Config, File, Index +from clang.cindex import Config, File, Index, TranslationUnit if "CLANG_LIBRARY_PATH" in os.environ: Config.set_library_path(os.environ["CLANG_LIBRARY_PATH"]) import unittest +kInputsDir = o

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-20 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/130383 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-20 Thread Vlad Serebrennikov via cfe-commits
@@ -1,12 +1,13 @@ import os -from clang.cindex import Config, File, Index +from clang.cindex import Config, File, Index, TranslationUnit if "CLANG_LIBRARY_PATH" in os.environ: Config.set_library_path(os.environ["CLANG_LIBRARY_PATH"]) import unittest +kInputsDir = o

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-20 Thread Vlad Serebrennikov via cfe-commits
@@ -16,3 +17,16 @@ def test_file(self): self.assertEqual(str(file), "t.c") self.assertEqual(file.name, "t.c") self.assertEqual(repr(file), "") + +def test_file_eq(self): +path = os.path.join(kInputsDir, "hello.cpp") +header_path = os.

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-19 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/130383 >From 8a206611120c15010381e1570c2b4d7548142dbd Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Thu, 19 Dec 2024 16:22:04 +0100 Subject: [PATCH 1/2] [libclang/python] Add equality comparison operators fo

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-08 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: I think the failure in question is ``` == FAIL: test_file_eq (tests.cindex.test_file.TestFile.test_file_eq) -- Traceback (most recent call last):

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-07 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: @Endilll do you understand where this test failure might come from? It passes for me locally... https://github.com/llvm/llvm-project/pull/130383 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-07 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum created https://github.com/llvm/llvm-project/pull/130383 This covers the `File` interface changes introduced added by #120590 >From 8a206611120c15010381e1570c2b4d7548142dbd Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Thu, 19 Dec 2024 16:22:04 +0100 Subje

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-07 Thread via cfe-commits
github-actions[bot] wrote: :warning: Python code formatter, darker found issues in your code. :warning: You can test this locally with the following command: ``bash darker --check --diff -r e22579a6752801a5d3ced59c7a2e2499d547c657...8a206611120c15010381e1570c2b4d7548142dbd clang

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Jannick Kremer (DeinAlptraum) Changes This covers the `File` interface changes added by #120590 --- Full diff: https://github.com/llvm/llvm-project/pull/130383.diff 3 Files Affected: - (modified) clang/bindings/python/clang/cindex.py (+

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-07 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum edited https://github.com/llvm/llvm-project/pull/130383 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits