From 80aefc9514262a026e013902fa3722e53181cd82 Mon Sep 17 00:00:00 2001
From: Georgi Gerganov <ggerganov@gmail.com>
Date: Fri, 21 Oct 2022 15:27:30 +0300
Subject: [PATCH] ci : fix and re-enable tests

---
 CMakeLists.txt | 8 ++++----
 whisper.cpp    | 6 ++++++
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c1cdd43..5ae5ba7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -171,8 +171,8 @@ if (WHISPER_STANDALONE)
     endif ()
 
     # TODO: temporary disabled
-    #if (WHISPER_BUILD_TESTS)
-    #    enable_testing()
-    #    add_subdirectory(tests)
-    #endif ()
+    if (WHISPER_BUILD_TESTS)
+        enable_testing()
+        add_subdirectory(tests)
+    endif ()
 endif ()
diff --git a/whisper.cpp b/whisper.cpp
index 2d2b8ce..55422b2 100644
--- a/whisper.cpp
+++ b/whisper.cpp
@@ -2477,6 +2477,12 @@ int whisper_full(
                     }
                     break;
                 }
+
+                // TESTS: if no tensors are loaded, it means we are running tests
+                if (ctx->model.tensors.size()) {
+                    seek_delta = 100*WHISPER_CHUNK_SIZE;
+                    break;
+                }
             }
 
             if (done) {