From 6ddd5ddcd8887c791152042609a47fc10f6ddbf5 Mon Sep 17 00:00:00 2001 From: Phillip Schmidt Date: Mon, 9 Sep 2019 16:05:37 -0700 Subject: [PATCH 1/2] unit test Wheel_Odometry_API: use default configuration, check for existence of calibration file --- unit-tests/unit-tests-live.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/unit-tests/unit-tests-live.cpp b/unit-tests/unit-tests-live.cpp index b34d26751d..7f653ab1a2 100644 --- a/unit-tests/unit-tests-live.cpp +++ b/unit-tests/unit-tests-live.cpp @@ -5548,7 +5548,6 @@ TEST_CASE("Wheel_Odometry_API", "[live]") REQUIRE(profile); REQUIRE_NOTHROW(dev = profile.get_device()); REQUIRE(dev); - disable_sensitive_options_for(dev); dev_type PID = get_PID(dev); CAPTURE(PID.first); @@ -5570,7 +5569,7 @@ TEST_CASE("Wheel_Odometry_API", "[live]") THEN("Load wheel odometry calibration") { std::ifstream calibrationFile("calibration_odometry.json"); - if (calibrationFile) + REQUIRE(calibrationFile); { const std::string json_str((std::istreambuf_iterator(calibrationFile)), std::istreambuf_iterator()); From 0d729cb85b42864ccf537a236fc9247de6cc749d Mon Sep 17 00:00:00 2001 From: Phillip Schmidt Date: Mon, 9 Sep 2019 16:16:07 -0700 Subject: [PATCH 2/2] unit test Wheel_Odometry_API: copy calibration file to build folder --- unit-tests/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/unit-tests/CMakeLists.txt b/unit-tests/CMakeLists.txt index 4cd5dd95b8..fd8f013007 100644 --- a/unit-tests/CMakeLists.txt +++ b/unit-tests/CMakeLists.txt @@ -51,6 +51,13 @@ add_custom_command(TARGET live-test POST_BUILD ${Deployment_Location} ) +# copy wheel odometry calibration file to build folder +add_custom_command(TARGET live-test POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/resources/calibration_odometry.json + ${CMAKE_CURRENT_BINARY_DIR}/calibration_odometry.json +) + #Post-Processing data set for unit-tests #message(STATUS "Post processing deployment directory=${Deployment_Location}") list(APPEND PP_Tests_List 1551257764229 # D415_DS(2)