Commit Graph

25 Commits

Author SHA1 Message Date
ykiko
bc04845293 refactor(tests): CMake-based CDB, workspace fixture, test cleanup (#378)
## Summary

- **CMake-based CDB generation for module tests**: Replace hand-written
compile_commands.json with CMakeLists.txt (CMake 3.28 `FILE_SET
CXX_MODULES`) in all 26 `tests/data/modules/*/` directories. CDB is
generated on-the-fly via `cmake -G Ninja` during test setup.
- **`@pytest.mark.workspace()` decorator**: Introduce a marker + fixture
pattern so tests declare their workspace via decorator and receive a
resolved `workspace` path. The fixture auto-generates CDB when a
CMakeLists.txt is present.
- **`CliceClient` helper methods**: Add `initialize()`, `open()`,
`wait_diagnostics()`, and `open_and_wait()` to reduce boilerplate across
all test files.
- **Use `asyncio_mode = "auto"`**: Switch from `@pytest_asyncio.fixture`
+ `@pytest.mark.asyncio` to `@pytest.fixture` + auto mode for proper
Pylance type inference on fixtures.
- **Test cleanup**: Remove redundant section separators and docstrings,
delete `tests/pyproject.toml` (config moved to `pytest.ini`).
- **Format task**: Add `.cppm` to `format-cpp` glob pattern.
- **CI fix**: Disable `CMAKE_CXX_SCAN_FOR_MODULES` and prefer pixi
clang++ to fix macOS CI where CMake rejects module scanning.

## Test plan

- [x] All 26 module test directories have CMakeLists.txt with FILE_SET
CXX_MODULES
- [x] generate_cdb() produces valid compile_commands.json with module
flags
- [x] Integration tests pass locally
- [ ] CI passes on all platforms (Linux, macOS, Windows)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Tests**
* Unified fixtures and client workflow: new init/open/wait helpers,
workspace marker support, bounded diagnostics waiting, CMake-based
compilation-database generation, and directory-backed temp-file
workflows; enabled asyncio test mode.
* **Chores**
* Added many C++20 module test projects and test data; removed prior
test pyproject in favor of pytest config; updated formatter to include
.cppm files.
* **Style**
* Reformatted many module/source implementations to consistent
multi-line function bodies.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-31 16:57:48 +08:00
ykiko
1da34574c9 build: use pixi for managing build toolchains (#322) 2025-12-16 01:53:25 +08:00
tang donghai
afe808274b Update LLVM build configuration to include clang-tools-extra project (#266) 2025-09-25 22:37:16 +08:00
ykiko
3cc3bae441 Format and simplify intergration test (#245) 2025-09-07 23:27:39 +08:00
Myriad-Dreamin
0c0e898dac Fix ruff python warning (#230) 2025-09-06 16:24:57 +08:00
ykiko
04cd848f3d Update docs (#174) 2025-08-13 20:21:54 +08:00
ykiko
a4c1d269c1 Remove Basic folder (#103) 2025-03-15 23:47:07 +08:00
star9029
8a56456e04 Add build doc (#72) 2025-02-12 00:10:19 +08:00
ykiko
9b98354918 Refactor async and fix error in index. (#55) 2025-02-03 01:26:37 +08:00
ykiko
6cd23038e4 Implement Indexer (#48) 2025-01-22 23:55:33 +08:00
ykiko
f419e7ee20 Clear scripts. 2025-01-17 16:50:08 +08:00
ykiko
11b41cf749 Add CI (#10) 2024-12-11 20:48:08 +08:00
ykiko
f9bff085b2 Fix Index tests. 2024-12-08 23:37:58 +08:00
ykiko
29fc40de6c Refactor Compiler.h. 2024-12-01 13:48:59 +08:00
ykiko
f6a023d156 Fix some memory issues in the Server. 2024-11-29 20:11:16 +08:00
ykiko
e1c9c70f54 Some update. 2024-11-19 21:43:49 +08:00
ykiko
ee2310fcd2 Add script to calculate code lines. 2024-10-31 14:59:27 +08:00
ykiko
d757758005 Update Index. 2024-10-17 23:20:32 +08:00
ykiko
14c9f9466d Update Index. 2024-10-17 21:51:20 +08:00
ykiko
796ace1925 Update build script. 2024-10-01 20:29:52 +08:00
ykiko
91bce3aa0c some update. 2024-09-27 22:58:43 +08:00
ykiko
80c5d0b2be add scripts. 2024-09-07 19:23:06 +08:00
ykiko
16f7a1f003 clear the project. 2024-08-29 20:10:14 +08:00
ykiko
0be4391cf5 some update. 2024-08-05 11:20:13 +08:00
ykiko
277fa22717 some update. 2024-07-14 21:42:24 +08:00