summaryrefslogtreecommitdiff
path: root/tests/projects/c++
diff options
context:
space:
mode:
authorruki <[email protected]>2024-07-24 23:37:54 +0800
committerGitHub <[email protected]>2024-07-24 23:37:54 +0800
commitdcd0c80fbde856820ed204d2b04fd51b3aa8ffae (patch)
tree9a00ff5f0d0540ae4a7c00c84a68abac3ef63513 /tests/projects/c++
parent4f359b270da52a3f2a9c6a6e30a550342896f21e (diff)
Update test.lua
Diffstat (limited to 'tests/projects/c++')
-rw-r--r--tests/projects/c++/modules/duplicate_name_detection/test.lua29
1 files changed, 17 insertions, 12 deletions
diff --git a/tests/projects/c++/modules/duplicate_name_detection/test.lua b/tests/projects/c++/modules/duplicate_name_detection/test.lua
index 5215735b5..34a153037 100644
--- a/tests/projects/c++/modules/duplicate_name_detection/test.lua
+++ b/tests/projects/c++/modules/duplicate_name_detection/test.lua
@@ -3,18 +3,23 @@ import("core.base.semver")
import("utils.ci.is_running", {alias = "ci_is_running"})
function _build()
- try {function()
- if ci_is_running() then
- os.iorun("xmake -rvD")
- else
- os.iorun("xmake -r")
- end
- end, catch {function(errors)
- errors = errors.errors
- if not errors or not errors:find("detected") then
- raise("Modules duplicate name detection does not work\n%s", errors.errors)
- end
- end}}
+ try {
+ function()
+ if ci_is_running() then
+ os.iorun("xmake -rvD")
+ else
+ os.iorun("xmake -r")
+ end
+ end,
+ catch {
+ function (errors)
+ errors = tostring(errors)
+ if not errors:find("duplicate module name detected", 1, true) then
+ raise("Modules duplicate name detection does not work\n%s", errors)
+ end
+ end
+ }
+ }
end
function can_build()