summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-12-28 22:49:49 +0800
committerruki <[email protected]>2023-12-28 22:49:49 +0800
commit22770be939cf1165cb41ca9119d55b07369b7405 (patch)
tree8d7b18fb0e019369b332c3c9ef63847aba8e2990
parent060626edbf26101044d6ab74f7f1af2fd755dc13 (diff)
update changelog
-rw-r--r--CHANGELOG.md8
-rw-r--r--tests/actions/test/test.lua2
-rw-r--r--xmake/actions/test/main.lua3
-rw-r--r--xmake/core/base/os.lua4
4 files changed, 16 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 165301c87..2fd0ed353 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,10 @@
## master (unreleased)
+### New features
+
+* [#4544](https://github.com/xmake-io/xmake/issues/4544): Support to wait process timeout for `xmake test`
+
## v2.8.6
### New features
@@ -1702,6 +1706,10 @@
## master (开发中)
+### 新特性
+
+* [#4544](https://github.com/xmake-io/xmake/issues/4544): 改进 `xmake test`,支持等待进程超时
+
## v2.8.6
### 新特性
diff --git a/tests/actions/test/test.lua b/tests/actions/test/test.lua
index 45ce0b914..3913c3d95 100644
--- a/tests/actions/test/test.lua
+++ b/tests/actions/test/test.lua
@@ -1,4 +1,4 @@
function main(t)
- os.exec("xmake test")
+ os.exec("xmake test -vD")
end
diff --git a/xmake/actions/test/main.lua b/xmake/actions/test/main.lua
index a61e40966..9313b381c 100644
--- a/xmake/actions/test/main.lua
+++ b/xmake/actions/test/main.lua
@@ -309,9 +309,12 @@ function _run_tests(tests)
cprint("${color.success}%d%%${clear} tests passed, ${color.failure}%d${clear} tests failed out of ${bright}%d${clear}, spent ${bright}%0.3fs",
passed_rate, report.total - report.passed, report.total, spent / 1000)
local return_zero = project.policy("test.return_zero_on_failure")
+ print("return_zero", return_zero)
if not return_zero and report.passed < report.total then
+ print("raise")
raise()
end
+ print("end")
end
-- try to build the given target
diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua
index 47cfb98b3..aca76db61 100644
--- a/xmake/core/base/os.lua
+++ b/xmake/core/base/os.lua
@@ -876,7 +876,11 @@ function os.execv(program, argv, opt)
if waitok > 0 then
ok = status
elseif waitok == 0 and opt.timeout then
+ print("kill .. ")
proc:kill()
+ print("kill end")
+ waitok, status = proc:wait(-1)
+ print("waitok", waitok, status)
errors = "wait process timeout"
end
else