ci: Clean up when restarting single includes test
This commit is contained in:
parent
6afa7d66cd
commit
644db2165e
|
@ -57,13 +57,21 @@ run_test() {
|
|||
run_test_wd() {
|
||||
local timeout="$1"
|
||||
test $# -gt 0 && shift
|
||||
|
||||
local cmd="$1"
|
||||
test $# -gt 0 && shift
|
||||
|
||||
local restart_cmd="$1"
|
||||
: ${restart_cmd:=true}
|
||||
test $# -gt 0 && shift
|
||||
|
||||
local test_name="$1"
|
||||
: ${test_name:=$cmd}
|
||||
test $# -gt 0 && shift
|
||||
|
||||
local output_file="$(mktemp)"
|
||||
local status_file="$(mktemp)"
|
||||
|
||||
local restarts=5
|
||||
local prev_tmpsize=-1
|
||||
while test $restarts -gt 0 ; do
|
||||
|
@ -92,6 +100,7 @@ run_test_wd() {
|
|||
# status file not updated, assuming hang
|
||||
kill -KILL $pid
|
||||
echo "Test ${test_name} hang up, restarting"
|
||||
eval "$restart_cmd"
|
||||
else
|
||||
local new_failed="$(cat "$status_file")"
|
||||
if test "x$new_failed" != "x0" ; then
|
||||
|
|
|
@ -12,8 +12,13 @@ enter_suite 'lint'
|
|||
|
||||
set -x
|
||||
|
||||
csi_clean() {
|
||||
rm "${BUILD_DIR}"/bin/test-includes-*
|
||||
find "${BUILD_DIR}" -name '*test-include*.o' -delete
|
||||
}
|
||||
|
||||
run_test 'top_make clint-full' clint
|
||||
run_test 'top_make testlint' testlint
|
||||
run_test_wd 5s 'top_make check-single-includes' single-includes
|
||||
run_test_wd 5s 'top_make check-single-includes' 'csi_clean' single-includes
|
||||
|
||||
exit_suite
|
||||
|
|
Loading…
Reference in New Issue