diff options
| author | ruki <[email protected]> | 2026-08-16 11:32:08 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-08-16 11:32:08 +0800 |
| commit | 2fa10294d414d3701fed76df6a786a0fe65c90b8 (patch) | |
| tree | 5e5de9a90decf8a22b1565157e739b00fb1aa004 /tests/actions/addon/test.lua | |
| parent | 65854acd5e7080dae4cac3e3b3ec1ce01e902ae7 (diff) | |
| parent | 58f6d2dd060b78afb0f1002c5586fc85dfca0629 (diff) | |
Merge pull request #7707 from xmake-io/repo
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 |
