Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions tests/tutorial-qml-ui-app.test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -697,17 +697,14 @@ sections:
action: wait_for
texts: ["Sections"]
timeout: 60000
- name: "Open the Modules system view"
- name: "Open the Module Inspector"
text: |
The doc comments you wrote on `calc_module`'s methods and events in
Part 1 also surface in basecamp. Open **Settings → Modules → Core
Modules**, then open `calc_module`'s **Interface** — each method and
event shows its `description`.
Part 1 also surface in basecamp. Open **Settings → Module
Inspector**, then open `calc_module`'s **Interface** — each method
and event shows its `description`.
action: click
target: "Modules"
- name: "Switch to the Core Modules tab"
action: click
target: "Core Modules"
target: "Module Inspector"
- name: "calc_module is listed"
action: wait_for
texts: ["calc_module"]
Expand All @@ -718,7 +715,7 @@ sections:
- name: "Open calc_module's Interface screen"
action: call_method
find_by: "objectName"
find_value: "coreModulesView"
find_value: "moduleInspectorView"
method: "openInterface"
args: ["calc_module"]
- name: "Method and event descriptions render (single- and multi-line)"
Expand All @@ -732,7 +729,7 @@ sections:
post_text: |
The result `8` comes back from `calc_module`: pressing **Add** calls `logos.callModule("calc_module", "add", [3, 5])`, which basecamp routes to your core module and back to the QML view. Both modules — the `calc_module` core plugin and the `calc_ui` view plugin — are loaded from the `basecamp-data` directory you installed them into.

The **Interface** screen (Settings → Modules → Core Modules → *Interface*) lists every method **and event** with the `description` from its doc comment — the same docs `lm` and `logoscore module-info` showed in Part 1, here in the GUI. Multi-line `///` comments render as multiple lines, exactly as written.
The **Interface** screen (Settings → Module Inspector → *Interface*) lists every method **and event** with the `description` from its doc comment — the same docs `lm` and `logoscore module-info` showed in Part 1, here in the GUI. Multi-line `///` comments render as multiple lines, exactly as written.

The sidebar labels each UI plugin by its `name` from `metadata.json`, which is why the tab reads `calc_ui`.

Expand Down
26 changes: 13 additions & 13 deletions tests/tutorial-wrapping-c-library.test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -595,10 +595,10 @@ sections:
# macOS
./lm/bin/lm methods result/lib/calc_module_plugin.dylib
expect_contains:
- "int add(int a, int b)"
- "int multiply(int a, int b)"
- "int factorial(int n)"
- "int fibonacci(int n)"
- "qlonglong add(qlonglong a, qlonglong b)"
- "qlonglong multiply(qlonglong a, qlonglong b)"
- "qlonglong factorial(qlonglong n)"
- "qlonglong fibonacci(qlonglong n)"
- "QString libVersion()"
- "Description: Adds two integers and returns the sum."
- "Defined as n * (n-1) * ... * 1, with 0! = 1."
Expand All @@ -613,25 +613,25 @@ sections:
Plugin Methods:
===============

int add(int a, int b)
Signature: add(int,int)
qlonglong add(qlonglong a, qlonglong b)
Signature: add(qlonglong,qlonglong)
Invokable: yes
Description: Adds two integers and returns the sum.

int multiply(int a, int b)
Signature: multiply(int,int)
qlonglong multiply(qlonglong a, qlonglong b)
Signature: multiply(qlonglong,qlonglong)
Invokable: yes
Description: Multiplies two integers and returns the product.

int factorial(int n)
Signature: factorial(int)
qlonglong factorial(qlonglong n)
Signature: factorial(qlonglong)
Invokable: yes
Description:
Computes the factorial n! of a non-negative integer.
Defined as n * (n-1) * ... * 1, with 0! = 1.

int fibonacci(int n)
Signature: fibonacci(int)
qlonglong fibonacci(qlonglong n)
Signature: fibonacci(qlonglong)
Invokable: yes
Description: Returns the nth Fibonacci number (0-indexed).

Expand All @@ -652,7 +652,7 @@ sections:

Three things to notice:

- **Signatures are Qt-typed** (`int`, `QString`) even though you wrote `int64_t` / `std::string`. That's the generated glue: `lm` reports the wire types the synthesized Qt plugin exposes, so `int64_t add(int64_t, int64_t)` shows up as `add(int,int)`.
- **Signatures are Qt-typed** (`qlonglong`, `QString`) even though you wrote `int64_t` / `std::string`. That's the generated glue: `lm` reports the wire types the synthesized Qt plugin exposes, so `int64_t add(int64_t, int64_t)` shows up as `add(qlonglong,qlonglong)`. Note the width is **preserved** — `qlonglong` is Qt's 64-bit integer, not `int`. Each type in the contract maps to exactly one type per language, and integers are 64-bit throughout, so a value that fits your `int64_t` cannot be silently truncated on the way across.
- **Each `Description` is your doc comment**, carried through the module's method introspection. Plain `//` comments (like the type-mapping note in the header) are deliberately ignored, so only intentional docs surface; an undocumented method simply omits it.
- **Line breaks are preserved** — a single-line comment renders inline; a multi-line comment (`factorial`, `libVersion`, `libVersionNotify`) keeps its breaks. The same descriptions appear in `logoscore module-info` and Basecamp's Methods list.

Expand Down
Loading