Skip to content

Commit

Permalink
Add file path macro for google test
Browse files Browse the repository at this point in the history
  • Loading branch information
200km committed Oct 23, 2023
1 parent 5cac20d commit cfe4522
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ if(GOOGLE_TEST)
set_target_properties(${TEST_PROJECT_NAME} PROPERTIES LANGUAGE CXX)
set_target_properties(${TEST_PROJECT_NAME} PROPERTIES CXX_STANDARD 17)
set_target_properties(${TEST_PROJECT_NAME} PROPERTIES CXX_EXTENSIONS FALSE)
target_compile_definitions(${TEST_PROJECT_NAME} PRIVATE "CORE_DIR_FROM_EXE=\"${CORE_DIR_FROM_EXE}\"")

endif()

Expand Down
3 changes: 2 additions & 1 deletion src/library/gnss/test_sp3_file_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
* @brief Test for Matrix * Vector
*/
TEST(Sp3FileReader, Constructor) {
Sp3FileReader sp3_file("../../src/library/gnss/example.sp3");
std::string test_file_name = "/src/library/gnss/example.sp3";
Sp3FileReader sp3_file(CORE_DIR_FROM_EXE + test_file_name);

// Test Header
EXPECT_EQ(2, sp3_file.GetNumberOfEpoch());
Expand Down

0 comments on commit cfe4522

Please sign in to comment.