Skip to content

Commit d21126d

Browse files
committed
test fix
1 parent 5c657e7 commit d21126d

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@ if(BAYSOR_WITH_TESTS)
186186
tests/test_main.cpp
187187
)
188188
target_link_libraries(baysor_tests PRIVATE baysor_lib GTest::gtest_main)
189+
target_compile_definitions(baysor_tests PRIVATE
190+
BAYSOR_TEST_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}"
191+
)
189192
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
190193
target_compile_options(baysor_tests PRIVATE -Wno-stringop-overflow)
191194
endif()

tests/test_main.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1842,15 +1842,14 @@ TEST(Xenium, ManifestHelpers) {
18421842
EXPECT_TRUE(baysor::is_xenium_manifest_path("experiment.xenium"));
18431843
EXPECT_FALSE(baysor::is_xenium_manifest_path("transcripts.parquet"));
18441844

1845-
const std::string manifest_path =
1846-
"../examples/Xenium_pancreas_membrane_377/data/experiment.xenium";
1847-
auto ctx = baysor::load_xenium_manifest_context(
1848-
manifest_path);
1845+
const std::filesystem::path dataset_dir =
1846+
std::filesystem::path(BAYSOR_TEST_SOURCE_DIR) /
1847+
"examples/Xenium_pancreas_membrane_377/data";
1848+
const std::string manifest_path = (dataset_dir / "experiment.xenium").string();
1849+
auto ctx = baysor::load_xenium_manifest_context(manifest_path);
18491850
EXPECT_EQ(ctx.manifest_path, manifest_path);
1850-
EXPECT_EQ(ctx.dataset_dir,
1851-
"../examples/Xenium_pancreas_membrane_377/data");
1852-
EXPECT_EQ(ctx.transcripts_path,
1853-
"../examples/Xenium_pancreas_membrane_377/data/transcripts.parquet");
1851+
EXPECT_EQ(ctx.dataset_dir, dataset_dir.string());
1852+
EXPECT_EQ(ctx.transcripts_path, (dataset_dir / "transcripts.parquet").string());
18541853
}
18551854

18561855
// ============================================================================

0 commit comments

Comments
 (0)