From ea00c22ea75598b1403b3204b2b0c78ca1cd3a6f Mon Sep 17 00:00:00 2001
From: Alfred Burgess <aburgess@ucc.gu.uwa.edu.au>
Date: Tue, 19 Dec 2023 12:28:33 +0800
Subject: [PATCH] Fixed issue with include test data on non-test build

---
 include/main.h | 4 +++-
 src/main.cpp   | 3 ---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/include/main.h b/include/main.h
index 57c47df..2449a85 100644
--- a/include/main.h
+++ b/include/main.h
@@ -4,8 +4,10 @@
 #include <iostream>
 #include <cstdint>
 
-#ifndef __TEST_RUNNER__
+#ifdef __TEST_RUNNER__
+#ifndef DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
 #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
+#endif // DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
 #include "doctest.h"
 #include "testlist.hpp"
 #endif // __TEST_RUNNER__
diff --git a/src/main.cpp b/src/main.cpp
index 82f1e0b..5b0ceb7 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -61,7 +61,4 @@ int main( int argc, char* argv[] ) {
 }
 // int /*WINAPI*/ WinMain(/*HINSTANCE hInstance, HINSTANCE, LPSTR, int*/) { main(); return 0; }
 
-#else
-#include "doctest.h"
-#include "testlist.hpp"
 #endif // __TEST_RUNNER__
-- 
GitLab