From e1b048d2b67adfc63400566312659bac91d894ea Mon Sep 17 00:00:00 2001 From: Joaquim Casals <jcasals@iri.upc.edu> Date: Thu, 23 May 2019 12:13:21 +0200 Subject: [PATCH] Moved utils_gtest.h to utils folder from test (plus minor update update script) --- CMakeLists.txt | 7 +- codetemplates eclipse.xml | 2 +- test/gtest_SE3.cpp | 2 +- test/gtest_capture_base.cpp | 2 +- test/gtest_ceres_manager.cpp | 2 +- test/gtest_converter.cpp | 2 +- test/gtest_eigen_predicates.cpp | 2 +- test/gtest_emplace.cpp | 2 +- test/gtest_example.cpp | 2 +- test/gtest_factor_absolute.cpp | 2 +- test/gtest_factor_autodiff.cpp | 2 +- test/gtest_factor_autodiff_distance_3D.cpp | 2 +- test/gtest_factor_odom_3D.cpp | 2 +- test/gtest_factor_pose_2D.cpp | 2 +- test/gtest_factor_pose_3D.cpp | 2 +- test/gtest_factor_sparse.cpp | 2 +- test/gtest_feature_base.cpp | 2 +- test/gtest_frame_base.cpp | 2 +- test/gtest_local_param.cpp | 2 +- test/gtest_make_posdef.cpp | 2 +- test/gtest_motion_buffer.cpp | 2 +- test/gtest_odom_2D.cpp | 2 +- test/gtest_odom_3D.cpp | 2 +- test/gtest_pack_KF_buffer.cpp | 2 +- test/gtest_param_prior.cpp | 2 +- test/gtest_param_server.cpp | 2 +- test/gtest_parser_yaml.cpp | 2 +- test/gtest_problem.cpp | 2 +- test/gtest_processor_base.cpp | 2 +- ...essor_frame_nearest_neighbor_filter_2D.cpp | 2 +- test/gtest_processor_motion.cpp | 2 +- test/gtest_rotation.cpp | 2 +- test/gtest_sensor_base.cpp | 2 +- test/gtest_shared_from_this.cpp | 2 +- test/gtest_solver_manager.cpp | 2 +- test/gtest_time_stamp.cpp | 2 +- test/gtest_track_matrix.cpp | 2 +- test/gtest_trajectory.cpp | 2 +- test/utils_gtest.h | 146 ------------------ wolf_scripts/templates/gtest_template.cpp | 2 +- wolf_scripts/wolf_update.sh | 2 +- 41 files changed, 43 insertions(+), 188 deletions(-) delete mode 100644 test/utils_gtest.h diff --git a/CMakeLists.txt b/CMakeLists.txt index e9e3f77c3..f62d07a3a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -233,14 +233,15 @@ SET(HDRS_MATH include/core/math/rotations.h ) SET(HDRS_UTILS + include/core/utils/converter.h include/core/utils/eigen_assert.h include/core/utils/eigen_predicates.h + include/core/utils/loader.hpp include/core/utils/logging.h include/core/utils/make_unique.h - include/core/utils/singleton.h include/core/utils/params_server.hpp - include/core/utils/converter.h - include/core/utils/loader.hpp + include/core/utils/singleton.h + include/core/utils/utils_gtest.h ) SET(HDRS_PROBLEM include/core/problem/problem.h diff --git a/codetemplates eclipse.xml b/codetemplates eclipse.xml index a83cc56bd..8fb5a247e 100644 --- a/codetemplates eclipse.xml +++ b/codetemplates eclipse.xml @@ -23,7 +23,7 @@ ${declarations} ${namespace_end}</template><template autoinsert="false" context="org.eclipse.cdt.core.cxxSource.contenttype_context" deleted="false" description="Default template for newly created C++ test files" enabled="true" id="org.eclipse.cdt.ui.text.codetemplates.cpptestfile" name="Default C++ test template">${filecomment} -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" ${includes} diff --git a/test/gtest_SE3.cpp b/test/gtest_SE3.cpp index a6146b661..c922ae4b0 100644 --- a/test/gtest_SE3.cpp +++ b/test/gtest_SE3.cpp @@ -7,7 +7,7 @@ #include "core/math/SE3.h" -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" diff --git a/test/gtest_capture_base.cpp b/test/gtest_capture_base.cpp index 8bb84231d..633669c7b 100644 --- a/test/gtest_capture_base.cpp +++ b/test/gtest_capture_base.cpp @@ -5,7 +5,7 @@ * Author: jsola */ -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" #include "core/capture/capture_base.h" #include "core/state_block/state_angle.h" diff --git a/test/gtest_ceres_manager.cpp b/test/gtest_ceres_manager.cpp index 4ab28374d..28cd36ced 100644 --- a/test/gtest_ceres_manager.cpp +++ b/test/gtest_ceres_manager.cpp @@ -5,7 +5,7 @@ * Author: jvallve */ -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" #include "core/utils/logging.h" #include "core/problem/problem.h" diff --git a/test/gtest_converter.cpp b/test/gtest_converter.cpp index 69bb7ce35..b49f30a2d 100644 --- a/test/gtest_converter.cpp +++ b/test/gtest_converter.cpp @@ -1,4 +1,4 @@ -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" #include "core/utils/converter.h" using namespace std; diff --git a/test/gtest_eigen_predicates.cpp b/test/gtest_eigen_predicates.cpp index c7c68b4f3..0207f811e 100644 --- a/test/gtest_eigen_predicates.cpp +++ b/test/gtest_eigen_predicates.cpp @@ -1,4 +1,4 @@ -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" #include "core/utils/eigen_predicates.h" diff --git a/test/gtest_emplace.cpp b/test/gtest_emplace.cpp index 92e42e440..cf6ae9004 100644 --- a/test/gtest_emplace.cpp +++ b/test/gtest_emplace.cpp @@ -5,7 +5,7 @@ * Author: jcasals */ -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" #include "core/utils/logging.h" #include "core/problem/problem.h" diff --git a/test/gtest_example.cpp b/test/gtest_example.cpp index 0cadea4ff..acfe5d6b7 100644 --- a/test/gtest_example.cpp +++ b/test/gtest_example.cpp @@ -1,4 +1,4 @@ -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" TEST(TestTest, DummyTestExample) { diff --git a/test/gtest_factor_absolute.cpp b/test/gtest_factor_absolute.cpp index da1cc8c05..af452608f 100644 --- a/test/gtest_factor_absolute.cpp +++ b/test/gtest_factor_absolute.cpp @@ -5,7 +5,7 @@ * \author: datchuth */ -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" #include "core/factor/factor_block_absolute.h" #include "core/factor/factor_quaternion_absolute.h" #include "core/capture/capture_motion.h" diff --git a/test/gtest_factor_autodiff.cpp b/test/gtest_factor_autodiff.cpp index efa61acc9..108ae75cd 100644 --- a/test/gtest_factor_autodiff.cpp +++ b/test/gtest_factor_autodiff.cpp @@ -5,7 +5,7 @@ * Author: jvallve */ -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" #include "core/sensor/sensor_odom_2D.h" #include "core/capture/capture_void.h" diff --git a/test/gtest_factor_autodiff_distance_3D.cpp b/test/gtest_factor_autodiff_distance_3D.cpp index c605a558d..6fb4c644e 100644 --- a/test/gtest_factor_autodiff_distance_3D.cpp +++ b/test/gtest_factor_autodiff_distance_3D.cpp @@ -11,7 +11,7 @@ #include "core/ceres_wrapper/ceres_manager.h" #include "core/math/rotations.h" -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" using namespace wolf; using namespace Eigen; diff --git a/test/gtest_factor_odom_3D.cpp b/test/gtest_factor_odom_3D.cpp index 09ae42b0c..7c239323a 100644 --- a/test/gtest_factor_odom_3D.cpp +++ b/test/gtest_factor_odom_3D.cpp @@ -5,7 +5,7 @@ * \author: jsola */ -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" #include "core/factor/factor_odom_3D.h" #include "core/capture/capture_motion.h" diff --git a/test/gtest_factor_pose_2D.cpp b/test/gtest_factor_pose_2D.cpp index bc50e6278..c28a8946e 100644 --- a/test/gtest_factor_pose_2D.cpp +++ b/test/gtest_factor_pose_2D.cpp @@ -6,7 +6,7 @@ */ #include "core/factor/factor_pose_2D.h" -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" #include "core/capture/capture_motion.h" diff --git a/test/gtest_factor_pose_3D.cpp b/test/gtest_factor_pose_3D.cpp index 45ee64674..eda34b179 100644 --- a/test/gtest_factor_pose_3D.cpp +++ b/test/gtest_factor_pose_3D.cpp @@ -6,7 +6,7 @@ */ #include "core/factor/factor_pose_3D.h" -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" #include "core/capture/capture_motion.h" diff --git a/test/gtest_factor_sparse.cpp b/test/gtest_factor_sparse.cpp index 6c8f212be..53d8b91a1 100644 --- a/test/gtest_factor_sparse.cpp +++ b/test/gtest_factor_sparse.cpp @@ -5,7 +5,7 @@ * \author: jsola */ -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" #include "factor_sparse.h" diff --git a/test/gtest_feature_base.cpp b/test/gtest_feature_base.cpp index 3a93ef2cb..713c044e2 100644 --- a/test/gtest_feature_base.cpp +++ b/test/gtest_feature_base.cpp @@ -7,7 +7,7 @@ #include "core/feature/feature_base.h" -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" using namespace wolf; using namespace Eigen; diff --git a/test/gtest_frame_base.cpp b/test/gtest_frame_base.cpp index 4cbc927bf..4f189f559 100644 --- a/test/gtest_frame_base.cpp +++ b/test/gtest_frame_base.cpp @@ -5,7 +5,7 @@ * Author: jsola */ -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" #include "core/utils/logging.h" #include "core/frame/frame_base.h" diff --git a/test/gtest_local_param.cpp b/test/gtest_local_param.cpp index 520a694f6..267d912b6 100644 --- a/test/gtest_local_param.cpp +++ b/test/gtest_local_param.cpp @@ -5,7 +5,7 @@ * author: jsola */ -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" #include "core/utils/logging.h" #include "core/state_block/local_parametrization_quaternion.h" diff --git a/test/gtest_make_posdef.cpp b/test/gtest_make_posdef.cpp index 5a0b707a6..18222fd3b 100644 --- a/test/gtest_make_posdef.cpp +++ b/test/gtest_make_posdef.cpp @@ -1,4 +1,4 @@ -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" #include "core/common/wolf.h" using namespace Eigen; diff --git a/test/gtest_motion_buffer.cpp b/test/gtest_motion_buffer.cpp index 3ef0bfaa0..8bd5f6659 100644 --- a/test/gtest_motion_buffer.cpp +++ b/test/gtest_motion_buffer.cpp @@ -5,7 +5,7 @@ * Author: jsola */ -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" #include "core/utils/logging.h" #include "core/processor/motion_buffer.h" diff --git a/test/gtest_odom_2D.cpp b/test/gtest_odom_2D.cpp index faa22aff3..a25cf1733 100644 --- a/test/gtest_odom_2D.cpp +++ b/test/gtest_odom_2D.cpp @@ -5,7 +5,7 @@ * \author: jsola */ -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" // Classes under test #include "core/processor/processor_odom_2D.h" diff --git a/test/gtest_odom_3D.cpp b/test/gtest_odom_3D.cpp index ce52ec393..3c13449ce 100644 --- a/test/gtest_odom_3D.cpp +++ b/test/gtest_odom_3D.cpp @@ -5,7 +5,7 @@ * \author: jsola */ -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" #include "core/common/wolf.h" #include "core/utils/logging.h" diff --git a/test/gtest_pack_KF_buffer.cpp b/test/gtest_pack_KF_buffer.cpp index c2b8958d0..6597f0f53 100644 --- a/test/gtest_pack_KF_buffer.cpp +++ b/test/gtest_pack_KF_buffer.cpp @@ -5,7 +5,7 @@ * Author: jsola */ //Wolf -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" #include "core/processor/processor_odom_2D.h" #include "core/sensor/sensor_odom_2D.h" diff --git a/test/gtest_param_prior.cpp b/test/gtest_param_prior.cpp index e5ddb8653..177961d92 100644 --- a/test/gtest_param_prior.cpp +++ b/test/gtest_param_prior.cpp @@ -5,7 +5,7 @@ * Author: jvallve */ -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" #include "core/utils/logging.h" #include "core/problem/problem.h" diff --git a/test/gtest_param_server.cpp b/test/gtest_param_server.cpp index a24b07a7e..3e83f8f89 100644 --- a/test/gtest_param_server.cpp +++ b/test/gtest_param_server.cpp @@ -1,4 +1,4 @@ -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" #include "core/utils/converter.h" #include "core/common/wolf.h" #include "core/yaml/parser_yaml.hpp" diff --git a/test/gtest_parser_yaml.cpp b/test/gtest_parser_yaml.cpp index 752c06fd2..97451a606 100644 --- a/test/gtest_parser_yaml.cpp +++ b/test/gtest_parser_yaml.cpp @@ -1,4 +1,4 @@ -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" #include "core/utils/converter.h" #include "core/common/wolf.h" #include "core/yaml/parser_yaml.hpp" diff --git a/test/gtest_problem.cpp b/test/gtest_problem.cpp index e25ba4bae..44fac86d1 100644 --- a/test/gtest_problem.cpp +++ b/test/gtest_problem.cpp @@ -5,7 +5,7 @@ * Author: jsola */ -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" #include "core/utils/logging.h" #include "core/problem/problem.h" diff --git a/test/gtest_processor_base.cpp b/test/gtest_processor_base.cpp index 9128e1ee6..cff4bc083 100644 --- a/test/gtest_processor_base.cpp +++ b/test/gtest_processor_base.cpp @@ -6,7 +6,7 @@ */ //Wolf -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" #include "core/processor/processor_odom_2D.h" #include "core/sensor/sensor_odom_2D.h" diff --git a/test/gtest_processor_frame_nearest_neighbor_filter_2D.cpp b/test/gtest_processor_frame_nearest_neighbor_filter_2D.cpp index 95b164253..82b3d2ae0 100644 --- a/test/gtest_processor_frame_nearest_neighbor_filter_2D.cpp +++ b/test/gtest_processor_frame_nearest_neighbor_filter_2D.cpp @@ -6,7 +6,7 @@ * \author: tessajohanna */ -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" #include "core/utils/logging.h" #include "core/sensor/sensor_odom_2D.h" diff --git a/test/gtest_processor_motion.cpp b/test/gtest_processor_motion.cpp index 60d175a6d..57d7a5c68 100644 --- a/test/gtest_processor_motion.cpp +++ b/test/gtest_processor_motion.cpp @@ -5,7 +5,7 @@ * Author: jsola */ -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" #include "core/common/wolf.h" #include "core/utils/logging.h" diff --git a/test/gtest_rotation.cpp b/test/gtest_rotation.cpp index 513cddd55..35335523c 100644 --- a/test/gtest_rotation.cpp +++ b/test/gtest_rotation.cpp @@ -18,7 +18,7 @@ #include <iomanip> #include <ctime> #include <cmath> -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" //#define write_results diff --git a/test/gtest_sensor_base.cpp b/test/gtest_sensor_base.cpp index d8420b2b3..499629f8f 100644 --- a/test/gtest_sensor_base.cpp +++ b/test/gtest_sensor_base.cpp @@ -7,7 +7,7 @@ #include "core/sensor/sensor_base.h" -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" using namespace wolf; diff --git a/test/gtest_shared_from_this.cpp b/test/gtest_shared_from_this.cpp index 6b14fff0c..b2d5217f4 100644 --- a/test/gtest_shared_from_this.cpp +++ b/test/gtest_shared_from_this.cpp @@ -1,4 +1,4 @@ -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" #include "core/common/node_base.h" class CChildBase; diff --git a/test/gtest_solver_manager.cpp b/test/gtest_solver_manager.cpp index 92fc07b84..815817a6e 100644 --- a/test/gtest_solver_manager.cpp +++ b/test/gtest_solver_manager.cpp @@ -5,7 +5,7 @@ * Author: jvallve */ -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" #include "core/utils/logging.h" #include "core/problem/problem.h" diff --git a/test/gtest_time_stamp.cpp b/test/gtest_time_stamp.cpp index 03b1d0582..7a39a5a6d 100644 --- a/test/gtest_time_stamp.cpp +++ b/test/gtest_time_stamp.cpp @@ -1,4 +1,4 @@ -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" #include "core/common/time_stamp.h" #include <thread> diff --git a/test/gtest_track_matrix.cpp b/test/gtest_track_matrix.cpp index 2f956b084..ff930b512 100644 --- a/test/gtest_track_matrix.cpp +++ b/test/gtest_track_matrix.cpp @@ -5,7 +5,7 @@ * \author: jsola */ -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" #include "core/processor/track_matrix.h" diff --git a/test/gtest_trajectory.cpp b/test/gtest_trajectory.cpp index f71bc579b..2edffe94d 100644 --- a/test/gtest_trajectory.cpp +++ b/test/gtest_trajectory.cpp @@ -5,7 +5,7 @@ * Author: jsola */ -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" #include "core/utils/logging.h" #include "core/problem/problem.h" diff --git a/test/utils_gtest.h b/test/utils_gtest.h deleted file mode 100644 index 9cb2166e8..000000000 --- a/test/utils_gtest.h +++ /dev/null @@ -1,146 +0,0 @@ -/** - * \file utils_gtest.h - * \brief Some utils for gtest - * \author Jeremie Deray - * Created on: 26/09/2016 - * Eigen macros extension by: Joan Sola on 26/04/2017 - */ - -#ifndef WOLF_UTILS_GTEST_H -#define WOLF_UTILS_GTEST_H - -#include <gtest/gtest.h> - -// Macros for testing equalities and inequalities. -// -// * {ASSERT|EXPECT}_EQ(expected, actual): Tests that expected == actual -// * {ASSERT|EXPECT}_NE(v1, v2): Tests that v1 != v2 -// * {ASSERT|EXPECT}_LT(v1, v2): Tests that v1 < v2 -// * {ASSERT|EXPECT}_LE(v1, v2): Tests that v1 <= v2 -// * {ASSERT|EXPECT}_GT(v1, v2): Tests that v1 > v2 -// * {ASSERT|EXPECT}_GE(v1, v2): Tests that v1 >= v2 -// -// C String Comparisons. All tests treat NULL and any non-NULL string -// as different. Two NULLs are equal. -// -// * {ASSERT|EXPECT}_STREQ(s1, s2): Tests that s1 == s2 -// * {ASSERT|EXPECT}_STRNE(s1, s2): Tests that s1 != s2 -// * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring case -// * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring case -// -// Macros for comparing floating-point numbers. -// -// * {ASSERT|EXPECT}_FLOAT_EQ(expected, actual): -// Tests that two float values are almost equal. -// * {ASSERT|EXPECT}_DOUBLE_EQ(expected, actual): -// Tests that two double values are almost equal. -// * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error): -// Tests that v1 and v2 are within the given distance to each other. -// -// These predicate format functions work on floating-point values, and -// can be used in {ASSERT|EXPECT}_PRED_FORMAT2*(), e.g. -// -// EXPECT_PRED_FORMAT2(testing::DoubleLE, Foo(), 5.0); -// -// Macros that execute statement and check that it doesn't generate new fatal -// failures in the current thread. -// -// * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); - -// http://stackoverflow.com/a/29155677 - -namespace testing -{ -namespace internal -{ -enum GTestColor -{ - COLOR_DEFAULT, - COLOR_RED, - COLOR_GREEN, - COLOR_YELLOW -}; - -extern void ColoredPrintf(GTestColor color, const char* fmt, ...); - -#define PRINTF(...) \ - do { testing::internal::ColoredPrintf(testing::internal::COLOR_GREEN,\ - "[ ] "); \ - testing::internal::ColoredPrintf(testing::internal::COLOR_YELLOW, __VA_ARGS__); } \ - while(0) - -#define PRINT_TEST_FINISHED \ -{ \ - const ::testing::TestInfo* const test_info = \ - ::testing::UnitTest::GetInstance()->current_test_info(); \ - PRINTF(std::string("Finished test case ").append(test_info->test_case_name()).\ - append(" of test ").append(test_info->name()).append(".\n").c_str()); \ -} - -// C++ stream interface -class TestCout : public std::stringstream -{ -public: - ~TestCout() - { - PRINTF("%s\n", str().c_str()); - } -}; - -/* Usage : - -TEST(Test, Foo) -{ - // the following works but prints default stream - EXPECT_TRUE(false) << "Testing Stream."; - - // or you can play with AINSI color code - EXPECT_TRUE(false) << "\033[1;31m" << "Testing Stream."; - - // or use the above defined macros - - PRINTF("Hello world"); - - // or - - TEST_COUT << "Hello world"; -} - -*/ -#define TEST_COUT testing::internal::TestCout() - -} // namespace internal - -/* Macros related to testing Eigen classes: - */ -#define EXPECT_MATRIX_APPROX(C_expect, C_actual, precision) EXPECT_PRED2([](const Eigen::MatrixXs lhs, const Eigen::MatrixXs rhs) { \ - return (lhs - rhs).isMuchSmallerThan(1, precision); \ - }, \ - C_expect, C_actual); - -#define ASSERT_MATRIX_APPROX(C_expect, C_actual, precision) ASSERT_PRED2([](const Eigen::MatrixXs lhs, const Eigen::MatrixXs rhs) { \ - return (lhs - rhs).isMuchSmallerThan(1, precision); \ - }, \ - C_expect, C_actual); - -#define EXPECT_QUATERNION_APPROX(C_expect, C_actual, precision) EXPECT_MATRIX_APPROX((C_expect).coeffs(), (C_actual).coeffs(), precision) - -#define ASSERT_QUATERNION_APPROX(C_expect, C_actual, precision) ASSERT_MATRIX_APPROX((C_expect).coeffs(), (C_actual).coeffs(), precision) - -#define EXPECT_POSE2D_APPROX(C_expect, C_actual, precision) EXPECT_PRED2([](const Eigen::MatrixXs lhs, const Eigen::MatrixXs rhs) { \ - MatrixXs er = lhs - rhs; \ - er(2) = pi2pi((Scalar)er(2)); \ - return er.isMuchSmallerThan(1, precision); \ - }, \ - C_expect, C_actual); - -#define ASSERT_POSE2D_APPROX(C_expect, C_actual, precision) EXPECT_PRED2([](const Eigen::MatrixXs lhs, const Eigen::MatrixXs rhs) { \ - MatrixXs er = lhs - rhs; \ - er(2) = pi2pi((Scalar)er(2)); \ - return er.isMuchSmallerThan(1, precision); \ - }, \ - C_expect, C_actual); - -} // namespace testing - -#endif /* WOLF_UTILS_GTEST_H */ diff --git a/wolf_scripts/templates/gtest_template.cpp b/wolf_scripts/templates/gtest_template.cpp index c797c1b5a..ccfec27db 100644 --- a/wolf_scripts/templates/gtest_template.cpp +++ b/wolf_scripts/templates/gtest_template.cpp @@ -1,4 +1,4 @@ -#include "utils_gtest.h" +#include "core/utils/utils_gtest.h" #include "wolf.h" #include "logging.h" diff --git a/wolf_scripts/wolf_update.sh b/wolf_scripts/wolf_update.sh index 1c7d44874..7a0ceac5b 100755 --- a/wolf_scripts/wolf_update.sh +++ b/wolf_scripts/wolf_update.sh @@ -29,7 +29,7 @@ for folder in wolf IMU laser gnss vision apriltag; do if ! cmake ..; then echo "" echo "===========================================================================================================================" - echo "${RED} CMake has failed, avorting process for $folder ${NC}" + echo "${YELLOW} CMake has failed, avorting process for $folder ${NC}" echo "===========================================================================================================================" echo "" sleep 1 -- GitLab