From: terencehill Date: Thu, 25 Jul 2024 17:39:57 +0000 (+0200) Subject: Speed up sv_game-hashtest.sh by executing qc tests and checking notifications at... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d4ec179d2f132fcef48b8ac92f50814ae70b39f1;p=xonotic%2Fxonotic-data.pk3dir.git Speed up sv_game-hashtest.sh by executing qc tests and checking notifications at the same time --- diff --git a/qcsrc/lib/test.qc b/qcsrc/lib/test.qc index 86b0e6187..6f65e878c 100644 --- a/qcsrc/lib/test.qc +++ b/qcsrc/lib/test.qc @@ -6,19 +6,19 @@ bool RUN_ALL_TESTS() int f = TEST_RunAll_accumulated(0); if (f) { - LOG_INFOF("%d tests failed", f); + LOG_HELPF("%d tests failed", f); return true; } else { - LOG_INFO("All tests OK"); + LOG_HELP("All tests OK"); return false; } } bool TEST_Run(string s) { - LOG_INFOF("%s: testing...", s); + LOG_HELPF("%s: testing...", s); TEST_failed = 0; TEST_fatal = 0; TEST_ok = false; @@ -26,12 +26,12 @@ bool TEST_Run(string s) if (isfunction(fn)) callfunction(fn); if (TEST_failed > 0) { - LOG_INFOF("%s: %d items failed.", s, TEST_failed); + LOG_HELPF("%s: %d items failed.", s, TEST_failed); return false; } else if (!TEST_ok) { - LOG_INFOF("%s: did not complete.", s); + LOG_HELPF("%s: did not complete.", s); return false; } return true; diff --git a/qcsrc/tools/sv_game-hashtest.sh b/qcsrc/tools/sv_game-hashtest.sh index 69a293b84..2f8c3dd6c 100755 --- a/qcsrc/tools/sv_game-hashtest.sh +++ b/qcsrc/tools/sv_game-hashtest.sh @@ -186,10 +186,8 @@ while read -r LINE do printf "%s\n" "$LINE" printf "%s\n" "$LINE" | grep -q ".*All tests OK$" && PASS=1 -done < <(${ENGINE} +developer 1 +map _init +sv_cmd runtest +wait +quit) +done < <(${ENGINE} +developer 1 +map _init +sv_cmd dumpnotifs +sv_cmd runtest +wait +quit) test "$PASS" = "1" || { printf "\033[1;31m%s\033[0m\n" "sv_cmd runtest failed!"; exit 1; } - -${ENGINE} +map _init +sv_cmd dumpnotifs +wait +quit diff notifications.cfg data/data/notifications_dump.cfg || { printf "Please update notifications.cfg using \`dumpnotifs\`!"; exit 1; }