소스 검색

Fixed TestHelper class

- added OS specific switch for different file path separators approaches
pcmattulat 4 년 전
부모
커밋
229dd9913b
1개의 변경된 파일20개의 추가작업 그리고 2개의 파일을 삭제
  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;
     }
 };