diff options
| author | ruki <[email protected]> | 2026-08-16 08:56:36 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2026-08-16 08:56:36 +0800 |
| commit | da447ac2ab5de57880d1179f5d3df7638ab5af23 (patch) | |
| tree | 1059b8cfc78db7c61e1fd7929bda00041c7e5ad4 /tests/actions/addon/test.lua | |
| parent | 65854acd5e7080dae4cac3e3b3ec1ce01e902ae7 (diff) | |
add packages test for addon
Diffstat (limited to 'tests/actions/addon/test.lua')
| -rw-r--r-- | tests/actions/addon/test.lua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/actions/addon/test.lua b/tests/actions/addon/test.lua index 192230b08..0b80a62e9 100644 --- a/tests/actions/addon/test.lua +++ b/tests/actions/addon/test.lua @@ -239,6 +239,22 @@ function test_template(t) end) end +-- an addon can ship the package definitions in its includes file, so that a project +-- only needs `add_requires`, @see tests/actions/addon/custom-package +function test_include_packages(t) + + -- @note we need a compiler here, the project links against the package + if not (find_program("gcc") or find_program("clang") or find_program("cc")) then + return + end + _with_addons({"custom-package"}, function () + _with_project("custom-package", function () + t:require(os.iorunv("xmake", {"build", "-y"}):find("build ok", 1, true)) + t:require(os.iorunv("xmake", {"run"}):find("hello from the custom package", 1, true)) + end) + end) +end + -- an addon can provide a toolchain and its tool modules -- -- @see tests/apis/custom_toolchain for the same toolchain maintained inside a project |
