@@ -59,10 +59,12 @@ runnable="1" iszip="0" statictk="0" notk="0" nomk4="0" + xcompile="0" + kitruncmd="" # Handle base configuration os="$(uname -s | dd conv=lcase 2>/dev/null)" cpu="$(uname -m | dd conv=lcase 2>/dev/null)" case "${kit}" in @@ -81,21 +83,23 @@ notk="1" kit="${os}-${cpu}-min-static" ;; win32|win32-*) kitcreator="./build/make-kit-win32" - runnable="0" + xcompile="1" + kitruncmd="wine" ;; linux-arm-min) kitcreator="./build/make-kit-arm" runnable="0" + xcompile="1" notk="1" iszip="1" ;; esac - if [ "${runnable}" != "1" ]; then + if [ "${xcompile}" != "0" ]; then kit="${kit}-xcompile" fi # Handle additional configuration tempkit="-${kit}-" @@ -296,16 +300,27 @@ for testscp in "${TESTDIR}"/tests/*.tcl; do testscp_tag="$(basename "${testscp}" .tcl)" testscppre="$(dirname "${testscp}")/${testscp_tag}.sh" scplogfile="${outputname}-${testscp_tag}.log" + # If a command is required to start the kit, prepare to kill it + # in case of timeout. + kitrunkillpid="" + if [ -n "${kitruncmd}" ]; then + ( + sleep 30 + killall "$(basename "${outputname}")" >/dev/null 2>/dev/null + ) >/dev/null 2>/dev/null & + kitrunkillpid="$!" + fi + ( if [ -f "${testscppre}" ]; then . "${testscppre}" fi - "${outputname}" "${testscp}" "${outputname}" "${kit}" "${version}" + ${kitruncmd} "${outputname}" "${testscp}" "${outputname}" "${kit}" "${version}" ) > "${scplogfile}" 2>&1 if [ "$?" != "0" ]; then echo "Script failed: ${testscp_tag} on ${version}/${kit}" >&2 @@ -313,10 +328,15 @@ echo "${testscp_tag}: FAIL" >> "${testresultslog}" continue fi + + # Kill the watchdog for this iteration + if [ -n "${kitrunkillpid}" ]; then + kill -9 "${kitrunkillpid}" >/dev/null 2>/dev/null + fi echo "${testscp_tag}: PASS" >> "${testresultslog}" rm -f "${scplogfile}" done