From daf48a5adffa304a5dfa001480c77bcf4f3e25ee Mon Sep 17 00:00:00 2001 From: Jared Van Bortel Date: Tue, 25 Feb 2025 14:44:12 -0500 Subject: [PATCH] fix test harder (it works now) --- gpt4all-backend-test/src/main.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/gpt4all-backend-test/src/main.cpp b/gpt4all-backend-test/src/main.cpp index abd5f390..4c77817a 100644 --- a/gpt4all-backend-test/src/main.cpp +++ b/gpt4all-backend-test/src/main.cpp @@ -8,14 +8,13 @@ #include #include +#include using gpt4all::backend::LLMProvider; -int main(int argc, char *argv[]) +static void run() { - QCoreApplication app(argc, argv); - fmt::print("Connecting to server at {}\n", OLLAMA_URL); LLMProvider provider(OLLAMA_URL); auto version = QCoro::waitFor(provider.getVersion()); @@ -23,6 +22,15 @@ int main(int argc, char *argv[]) fmt::print("Server version: {}\n", *version); } else { fmt::print("Network error: {}\n", version.error().errorString); - return 1; + return QCoreApplication::exit(1); } + QCoreApplication::exit(0); +} + + +int main(int argc, char *argv[]) +{ + QCoreApplication app(argc, argv); + QTimer::singleShot(0, &run); + return app.exec(); }