Bläddra i källkod

Fixed TestHelper class

- added OS specific switch for different file path separators approaches
pcmattulat 4 år sedan
förälder
incheckning
229dd9913b
1 ändrade filer med 20 tillägg och 2 borttagningar
  1. 20 2
      test/TestHelper.hpp

+ 20 - 2
test/TestHelper.hpp

@@ -19,11 +19,29 @@ class TestHelper {
     ~TestHelper() = default;
 
     static std::string getResourcesFolderLocation() {
-      return TestHelper::getTestFolderLocation() + R"(resources\)";
+      std::string location {};
+
+      #ifdef _WIN32
+        location = TestHelper::getTestFolderLocation() + R"(resources\)";
+      #endif
+      #ifdef unix
+        location = TestHelper::getTestFolderLocation() + R"(resources/)";
+      #endif
+
+      return location;
     }
 
     static std::string getTestFolderLocation() {
-      return R"(C:\Users\drums\CLionProjects\lynar-studios-standard-library\test\)";
+      std::string location {};
+
+      #ifdef _WIN32
+        location = R"(C:\Users\drums\CLionProjects\lynar-studios-standard-library\test\)";
+      #endif
+      #ifdef unix
+        location = R"(/home/patrick/CLionProjects/lynar-studios-standard-library/test/)";
+      #endif
+
+      return location;
     }
 };