Repository navigation
refactor(tests): CMake-based CDB, workspace fixture, test cleanup #378
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
5fdd857
refactor(tests): unify TempFile→TempDir, extract shared helpers
16bit-ykiko 3241c5e
refactor(tests): move LSP helpers to CliceClient methods
16bit-ykiko e5e60f5
refactor(tests): use CMake+Ninja to generate CDB for module tests
16bit-ykiko 217982e
fix(tests): address CodeRabbit review comments
16bit-ykiko 76dd648
fix(tests): use CMake 3.28 FILE_SET CXX_MODULES for proper module sup…
16bit-ykiko dd7f31d
fix(tests): stop copying CDB from build/ to workspace root
16bit-ykiko 8fa3e11
fix(tests): use CMake 3.28 FILE_SET CXX_MODULES for proper module sup…
16bit-ykiko abf08c7
refactor(tests): add @pytest.mark.workspace decorator for cleaner tes…
16bit-ykiko 9c435b1
refactor(tests): auto-initialize client in fixture, add type annotations
16bit-ykiko 7047cb4
style(tests): remove type annotations from test function parameters
16bit-ykiko 7a22571
fix(tests): use AsyncGenerator for client fixture return type
16bit-ykiko b89b8b8
refactor(tests): use asyncio_mode=auto, clean up redundant comments, …
16bit-ykiko 40c3450
fix(tests): fix cmake CDB generation on macOS CI
16bit-ykiko 8555072
fix(tests): correct expected error line in test_module_compile_error
16bit-ykiko c135864
fix(tests): use project toolchain for CDB generation on macOS CI
16bit-ykiko b7c1fa2
fix(tests): disable CMAKE_CXX_SCAN_FOR_MODULES for Windows CI
16bit-ykiko aa4e3dd
refactor: use clang++ instead of clang-cl on Windows
16bit-ykiko 5f95196
fix(tests): address CodeRabbit review feedback
16bit-ykiko 10b56f8
refactor: use clang++ instead of clang-cl on Windows
16bit-ykiko ce1aabd
fix: restore clang-cl ASan linking logic alongside clang++ path
16bit-ykiko 0f945c5
refactor: simplify toolchain and fix ASan detection for clang++ on Wi…
16bit-ykiko 6d17812
fix(windows): disable ICF in Debug to avoid ASan ODR false positives
16bit-ykiko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| @echo off | ||
| for /f "delims=" %%i in ('clang-cl --print-resource-dir') do set "CLANG_RES=%%i" | ||
| for /f "delims=" %%i in ('clang++ --print-resource-dir') do set "CLANG_RES=%%i" | ||
| set "PATH=%CLANG_RES%\lib\windows;%PATH%" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| cmake_minimum_required(VERSION 3.28) | ||
| project(chained_modules LANGUAGES CXX) | ||
|
|
||
| set(CMAKE_CXX_STANDARD 20) | ||
| set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||
|
|
||
| add_library(test) | ||
| target_sources(test | ||
| PUBLIC | ||
| FILE_SET CXX_MODULES | ||
| FILES mod_a.cppm mod_b.cppm | ||
| ) | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,5 @@ | ||
| export module A; | ||
| export int foo() { return 42; } | ||
|
|
||
| export int foo() { | ||
| return 42; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,6 @@ | ||
| export module B; | ||
| import A; | ||
| export int bar() { return foo() + 1; } | ||
|
|
||
| export int bar() { | ||
| return foo() + 1; | ||
| } |
13 changes: 13 additions & 0 deletions
13
tests/data/modules/circular_module_dependency/CMakeLists.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| cmake_minimum_required(VERSION 3.28) | ||
| project(circular_module_dependency LANGUAGES CXX) | ||
|
|
||
| set(CMAKE_CXX_STANDARD 20) | ||
| set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||
|
|
||
| add_library(test) | ||
| target_sources(test | ||
| PUBLIC | ||
| FILE_SET CXX_MODULES | ||
| FILES cycle_a.cppm cycle_b.cppm ok.cppm | ||
| ) | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,6 @@ | ||
| export module CycA; | ||
| import CycB; | ||
| export int a() { return 1; } | ||
|
|
||
| export int a() { | ||
| return 1; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,6 @@ | ||
| export module CycB; | ||
| import CycA; | ||
| export int b() { return 2; } | ||
|
|
||
| export int b() { | ||
| return 2; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,5 @@ | ||
| export module Ok; | ||
| export int ok() { return 42; } | ||
|
|
||
| export int ok() { | ||
| return 42; | ||
| } |
13 changes: 13 additions & 0 deletions
13
tests/data/modules/class_export_and_inheritance/CMakeLists.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| cmake_minimum_required(VERSION 3.28) | ||
| project(class_export_and_inheritance LANGUAGES CXX) | ||
|
|
||
| set(CMAKE_CXX_STANDARD 20) | ||
| set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||
|
|
||
| add_library(test) | ||
| target_sources(test | ||
| PUBLIC | ||
| FILE_SET CXX_MODULES | ||
| FILES shape.cppm circle.cppm | ||
| ) | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,13 @@ | ||
| export module Circle; | ||
| import Shape; | ||
|
|
||
| export class Circle : public Shape { | ||
| int r; | ||
|
|
||
| public: | ||
| Circle(int r) : r(r) {} | ||
| int area() const override { return 3 * r * r; } | ||
|
|
||
| int area() const override { | ||
| return 3 * r * r; | ||
| } | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| export module Shape; | ||
|
|
||
| export class Shape { | ||
| public: | ||
| virtual ~Shape() = default; | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.