From 7c179b39b87be6edf1eb544d9dad7cf906c3a04d Mon Sep 17 00:00:00 2001 From: Kamil Ritz Date: Sat, 1 Feb 2020 16:19:59 +0100 Subject: [PATCH] Make test with Clang --- .github/workflows/build_tests.yml | 10 ++++------ test/gtest.cmake | 7 ------- test/sensor_simulator/sensor_simulator.h | 1 + test/test_EKF_airspeed.cpp | 2 +- test/test_EKF_imuSampling.cpp | 2 +- 5 files changed, 7 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build_tests.yml b/.github/workflows/build_tests.yml index 449b6e1a70..e3a8b58373 100644 --- a/.github/workflows/build_tests.yml +++ b/.github/workflows/build_tests.yml @@ -27,9 +27,8 @@ jobs: run: make - name: clean build run: make clean - # TODO: This is not running at the moment - #- name: main test - # run: make test + - name: main test + run: make test Mac-OS: runs-on: macos-latest steps: @@ -38,6 +37,5 @@ jobs: run: make - name: clean build run: make clean - # TODO: This is not running at the moment - #- name: main test - # run: make test + - name: main test + run: make test diff --git a/test/gtest.cmake b/test/gtest.cmake index 8e1bff7661..94c4103ce5 100644 --- a/test/gtest.cmake +++ b/test/gtest.cmake @@ -41,10 +41,3 @@ endif() # Add googletest, defines gtest and gtest_main targets add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/googletest-src ${CMAKE_CURRENT_BINARY_DIR}/googletest-build EXCLUDE_FROM_ALL) - -# Remove visibility.h from the compile flags for gtest because of poisoned exit() -get_target_property(GTEST_COMPILE_FLAGS gtest COMPILE_OPTIONS) -list(REMOVE_ITEM GTEST_COMPILE_FLAGS "-include") -list(REMOVE_ITEM GTEST_COMPILE_FLAGS "visibility.h") -set_target_properties(gtest PROPERTIES COMPILE_OPTIONS "${GTEST_COMPILE_FLAGS}") - diff --git a/test/sensor_simulator/sensor_simulator.h b/test/sensor_simulator/sensor_simulator.h index 5ee6d92d43..6bd41b2c70 100644 --- a/test/sensor_simulator/sensor_simulator.h +++ b/test/sensor_simulator/sensor_simulator.h @@ -47,6 +47,7 @@ #include #include #include +#include #include "imu.h" #include "mag.h" diff --git a/test/test_EKF_airspeed.cpp b/test/test_EKF_airspeed.cpp index f9bf612d39..66dd96d93a 100644 --- a/test/test_EKF_airspeed.cpp +++ b/test/test_EKF_airspeed.cpp @@ -96,7 +96,7 @@ TEST_F(EkfAirspeedTest, testWindVelocityEstimation) EXPECT_TRUE(matrix::isEqual(vel, simulated_velocity_earth)); const Vector3f vel_wind_expected = simulated_velocity_earth - R_to_earth_sim * (Vector3f(airspeed_body(0), airspeed_body(1), 0.0f)); EXPECT_TRUE(matrix::isEqual(vel_wind_earth, Vector2f(vel_wind_expected.slice<2,1>(0,0)))); - EXPECT_FLOAT_EQ(height_before_pressure_correction, 0.0f); + EXPECT_NEAR(height_before_pressure_correction, 0.0f, 1e-5f); // Apply height correction const float static_pressure_coef_xp = 1.0f; diff --git a/test/test_EKF_imuSampling.cpp b/test/test_EKF_imuSampling.cpp index c20c4048cc..5ee426e44b 100644 --- a/test/test_EKF_imuSampling.cpp +++ b/test/test_EKF_imuSampling.cpp @@ -94,7 +94,7 @@ TEST_P(EkfImuSamplingTest, imuSamplingAtMultipleRates) EXPECT_TRUE(matrix::isEqual(accel, imu_sample_buffered.delta_vel/imu_sample_buffered.delta_vel_dt, 1e-7f)); } -INSTANTIATE_TEST_CASE_P(imuSamplingAtMultipleRates, +INSTANTIATE_TEST_SUITE_P(imuSamplingAtMultipleRates, EkfImuSamplingTest, ::testing::Values( std::make_tuple(1.0f, 1.0f,Vector3f{0.0f,0.0f,0.0f},Vector3f{-0.46f,0.87f,0.20f}),