Files
clice/docs/en/dev/test-and-debug.md
ykiko c14b8de18f chore: remove xmake, clean up unused files, simplify CLI parsing (#392)
## Summary
- **Remove xmake build system**: delete `xmake.lua`, `test-xmake.yml`
workflow, and all xmake-related pixi tasks
- **Migrate packaging to CMake**: `publish-clice.yml` now uses `cmake
-DCLICE_RELEASE=ON` instead of xmake pack
- **Clean up**: remove unused `tests/uv.lock`, `.xmake/` from
`.gitignore`, xmake references from docs
- **Benchmark CI**: change trigger from `pull_request` to
`workflow_dispatch` (manual only)
- **Simplify CLI parsing**: use `DecoKV(style =
KVStyle::JoinedOrSeparate)` in `clice.cc` and `unit_tests.cc`, replacing
verbose `DecoKVStyled` with manual `static_cast` bitmask; use comma
separators; explicit `names` only for underscore fields

## Test plan
- [x] `pixi run cmake-build RelWithDebInfo` compiles successfully
- [x] Verify `pixi run test` passes
- [x] Verify `pixi run package` produces correct archives via CMake
release build
- [x] Verify benchmark workflow can be triggered manually via `gh
workflow run benchmark`

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

## Summary by CodeRabbit

* **Chores**
* Consolidated CI workflows; some automated triggers converted to manual
invocation
* Standardized shell for workflow steps and removed legacy build
workflow
* Switched packaging/build tasks to a CMake/Ninja flow and updated
artifact paths
  * Adjusted ignore rules to include previously-ignored build metadata

* **Documentation**
* Removed XMake-specific build and test instructions; docs now reflect
the CMake-based workflow

* **Style**
* Updated CLI option declaration style (no user-facing flag name
changes)

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 17:33:20 +08:00

2.8 KiB

Test and Debug

Run Tests

clice has two types of tests: unit tests and integration tests.

  • Run unit tests
$ ./build/bin/unit_tests --test-dir="./tests/data"
  • Run integration tests

We use pytest to run integration tests. Please refer to pyproject.toml to install the required Python libraries.

$ pytest -s --log-cli-level=INFO tests/integration --executable=./build/bin/clice

Debug

If you want to attach a debugger to clice for debugging, it is recommended to first start clice in socket mode independently, and then connect the client to it.

$ ./build/bin/clice --mode=socket --port=50051

After the server starts, you can connect a client to the server in the following two ways:

  • Connect by running a specific test with pytest

You can run a single integration test case to connect to a running clice instance. This is very useful for reproducing and debugging specific scenarios.

$ pytest -s --log-cli-level=INFO tests/integration/test_file_operation.py::test_did_open --mode=socket --port=50051
  • Use VS Code for practical testing

You can also connect to a running clice service by configuring the clice-vscode extension, allowing you to debug in a real-world usage scenario.

  1. Download the clice-vscode extension from the Marketplace.

  2. Configure settings.json: Create a .vscode/settings.json file in your project's root directory and add the following content:

    {
      // Point this to the clice binary you downloaded.
      "clice.executable": "/path/to/your/clice/executable",
    
      // Enable socket mode.
      "clice.mode": "socket",
      "clice.port": 50051,
    
      // Optional: Set this to an empty string to turn off the clangd.
      "clangd.path": "",
    }
    
  3. Reload Window: After modifying the configuration, execute the Developer: Reload Window command in VS Code for the settings to take effect. The extension will automatically connect to the clice instance listening on port 50051.

If you need to modify or debug the clice-vscode extension itself, follow these steps:

  1. Clone and install dependencies:

    $ git clone https://github.com/clice-io/clice-vscode
    $ cd clice-vscode
    $ npm install
    
  2. Open the extension project with VS Code: Open the clice-vscode folder in a new VS Code window.

  3. Create debug configuration: In the clice-vscode project, also create a .vscode/settings.json file with the same content as above.

  4. Press F5. This will launch an [Extension Development Host] window. This is a new VS Code window with your local clice-vscode extension code loaded. Open your C++ project in this new window, and it should automatically connect to clice.