Skip to content

Commit 99b2683

Browse files
kongchen1992meta-codesync[bot]
authored andcommitted
{Build} Core - Pass TEST_FOLDER_GEN2 to mps unit tests
Summary: Explanation: The recently added Gen2 reader test cases in `core/mps/test/TestEyeGaze.cpp` reference `XSTRING(TEST_FOLDER_GEN2)`, but `core/mps/test/CMakeLists.txt` was not updated to pass `-DTEST_FOLDER_GEN2`. With the macro undefined at compile time, the stringification expands to the literal token `"TEST_FOLDER_GEN2"`, so the reader is handed nonsensical paths like `"TEST_FOLDER_GEN2mps_sample/eye_gaze/general_eye_gaze.csv"`, returns an empty vector, and the `ASSERT_EQ(5u, eyegazeValues.size())` assertion trips. This breaks `mps_eyegaze_gen2_valid_file.reader` and the parent `mps_TestEyeGaze` binary on every CI job (Ubuntu + macOS). This diff adds `-DTEST_FOLDER_GEN2=${GEN2_TEST_DATA_PATH}` to the compile definitions in `core/mps/test/CMakeLists.txt`, mirroring the pattern already used in `core/data_provider/test/CMakeLists.txt`. `GEN2_TEST_DATA_PATH` is already set in the top-level `CMakeLists.txt`. Reproducibility: With the fix, `mps_eyegaze_gen2_valid_file.reader` and `mps_TestEyeGaze` both go green; without it, both fail in the GitHub Actions C++ Build_Test jobs on both Ubuntu and macOS. ___ Reviewed By: nrraina Differential Revision: D108186945 fbshipit-source-id: ef1471f3563566787f4a190fafeb831450f47803
1 parent 5bc4408 commit 99b2683

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

core/mps/test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ foreach(X IN LISTS TEST_FILES)
3030
add_test(NAME mps_${filenameWithoutExt} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
3131
COMMAND $<TARGET_FILE:mps_${filenameWithoutExt}>)
3232
target_compile_definitions(mps_${filenameWithoutExt}
33-
PRIVATE -DTEST_FOLDER=${GEN1_TEST_DATA_PATH})
33+
PRIVATE -DTEST_FOLDER=${GEN1_TEST_DATA_PATH} -DTEST_FOLDER_GEN2=${GEN2_TEST_DATA_PATH})
3434
endforeach()

0 commit comments

Comments
 (0)