-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
40 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,21 +122,21 @@ include(FetchContent) | |
|
||
if (RGL_BUILD_INTEGRATION_TEST) | ||
FetchContent_Declare( | ||
rgltest | ||
tapedtest | ||
GIT_REPOSITORY [email protected]:RobotecAI/RGL-blobs.git | ||
GIT_TAG test/integration-using-tape | ||
) | ||
|
||
FetchContent_GetProperties(rgltest) | ||
if (NOT rgltest_POPULATED) | ||
FetchContent_Populate(rgltest) | ||
FetchContent_GetProperties(tapedtest) | ||
if (NOT tapedtest_POPULATED) | ||
FetchContent_Populate(tapedtest) | ||
endif() | ||
|
||
set(RGL_INTEGRATION_TEST_FILES | ||
${rgltest_SOURCE_DIR}/test/IntegrationTest.cpp | ||
src/TapedTest.cpp | ||
) | ||
|
||
file(COPY ${rgltest_SOURCE_DIR}/tapes DESTINATION ${CMAKE_BINARY_DIR}/data) | ||
file(COPY ${tapedtest_SOURCE_DIR}/tapes DESTINATION ${CMAKE_BINARY_DIR}/data) | ||
|
||
add_executable(RobotecGPULidar_integration_test ${RGL_INTEGRATION_TEST_FILES}) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include <helpers/commonHelpers.hpp> | ||
#include <rgl/api/extensions/tape.h> | ||
#include <Logger.hpp> | ||
|
||
#include <filesystem> | ||
#include <fstream> | ||
|
||
class TapedTest : public RGLTest | ||
{}; | ||
|
||
TEST_F(TapedTest, compare_pcd_files) | ||
{ | ||
#if RGL_BUILD_PCL_EXTENSION | ||
std::string testTapePath{std::filesystem::current_path().parent_path().string() + "/data/tapes/minimal"}; | ||
std::string expectedOutputPath{std::filesystem::current_path().parent_path().string() + | ||
"/data/tapes/expected-output/minimal.pcd"}; | ||
std::string outputPath{std::filesystem::current_path().string() + "/minimal.pcd"}; | ||
|
||
ASSERT_RGL_SUCCESS(rgl_tape_play(testTapePath.c_str())); | ||
|
||
std::ifstream expectedOutputFile(expectedOutputPath, std::ios::binary); | ||
std::ifstream outputFile(outputPath, std::ios::binary); | ||
|
||
std::vector<char> expectedOutput((std::istreambuf_iterator<char>(expectedOutputFile)), std::istreambuf_iterator<char>()); | ||
std::vector<char> output((std::istreambuf_iterator<char>(outputFile)), std::istreambuf_iterator<char>()); | ||
|
||
EXPECT_EQ(expectedOutput, output); | ||
#else | ||
GTEST_SKIP(); | ||
RGL_WARN("RGL compiled without PCL extension. Integration test skipped."); | ||
#endif | ||
} |