]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Speed up sv_game-hashtest.sh by executing qc tests and checking notifications at...
authorterencehill <piuntn@gmail.com>
Thu, 25 Jul 2024 17:39:57 +0000 (19:39 +0200)
committerterencehill <piuntn@gmail.com>
Thu, 25 Jul 2024 17:39:57 +0000 (19:39 +0200)
qcsrc/lib/test.qc
qcsrc/tools/sv_game-hashtest.sh

index 86b0e6187010fde8175bb4040e70c60c819a0f0c..6f65e878c889eedd6a2adf4ffbe1f3e98313e92e 100644 (file)
@@ -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;
index 69a293b84e70c2fed474e18dc8140380bf713277..2f8c3dd6c387120d2cb60bc011ee734d2fed37af 100755 (executable)
@@ -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; }