]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/test.qc
Merge remote-tracking branch 'origin/Mario/gameover_fixes'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / test.qc
index 23b0327683f15ba7f744a4edb64ae35dd8e89b53..0997e53a4964fe1657c045ce01f4f698f1a7259b 100644 (file)
@@ -1,22 +1,7 @@
 #include "test.qh"
 
-int TEST_failed;
-bool TEST_ok;
-
-void TEST_Fail(string cond)
-{
-       LOG_INFOF("Assertion failed: ", cond);
-       // backtrace();
-       ++TEST_failed;
-}
-
-void TEST_OK()
-{
-       TEST_ok = true;
-}
-
 int TEST_RunAll_accumulated(int init);
-bool TEST_RunAll()
+bool RUN_ALL_TESTS()
 {
        int f = TEST_RunAll_accumulated(0);
        if (f)
@@ -35,8 +20,10 @@ bool TEST_Run(string s)
 {
        LOG_INFOF("%s: testing...\n", s);
        TEST_failed = 0;
+       TEST_fatal = 0;
        TEST_ok = false;
-       callfunction(strcat("_TEST_", s));
+       string fn = strcat("_TEST_", s);
+       if (isfunction(fn)) callfunction(fn);
        if (TEST_failed > 0)
        {
                LOG_INFOF("%s: %d items failed.\n", s, TEST_failed);