-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CI] Run unit tests #476
base: master
Are you sure you want to change the base?
[CI] Run unit tests #476
Conversation
GoogleTest is packaged in subdirectory. ls -lah downloads/googletest-release-1.11.0/* drwxrwxr-x 2 4.0K Jun 11 2021 ci drwxrwxr-x 8 4.0K Jun 11 2021 googlemock drwxrwxr-x 9 4.0K Jun 11 2021 googletest # .... First download the zip file, then unzip to a tmp dir and finaly move googletest to tools directory
This will ignore warning in gtest since it is not compatible with some of the flags beeing enforced gtest.cc:1266:43: error: implicit conversion from ‘float’ to ‘double’ to match other operand of binary expression [-Werror=double-promotion] 1266 | costs[l_i + 1][r_i + 1] = replace + 1.00001; | ~~~~~~~~^~~~~~~~~
Compile with -O1 to make inline functions compatible with gcc utils_math.c:582: undefined reference to `utils_truncate_number' error: ld returned 1 exit status
Unused variable ret causes error : unittest.cpp: In member function ‘virtual void Saturate2dVector_ValsOnEdgeOfRange_Test::TestBody()’: unittest.cpp:291:9: error: variable ‘ret’ set but not used [-Werror=unused-but-set-variable] 291 | bool ret; | ^~~
@@ -18,7 +18,7 @@ CXXFLAGS += -g -Wall -Wextra -Wno-missing-field-initializers -std=c++11 | |||
LDFLAGS += -lpthread | |||
|
|||
# Google Test requires visibility of gtest includes | |||
GTEST_CXXFLAGS := -I$(GTEST_DIR) | |||
GTEST_CXXFLAGS := -isystem $(GTEST_DIR) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will ignore the double-promotion warnings on gtest.
gtest.cc:1266:43:
error: implicit conversion from ‘float’ to ‘double’ to match other
operand of binary expression [-Werror=double-promotion]
1266 | costs[l_i + 1][r_i + 1] = replace + 1.00001;
``
@@ -296,15 +296,15 @@ TEST_F(Saturate2dVector, ValsOnEdgeOfRange) { | |||
ret = utils_saturate_vector_2d(&inputVal_x, &inputVal_y, inputVal_max); | |||
EXPECT_FLOAT_EQ(1, inputVal_x); | |||
EXPECT_FLOAT_EQ(1, inputVal_y); | |||
/* EXPECT_EQ(false, ret); <-- Do not test, since this is on the edge and we don't need to know if it's explicitly inside or outside*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why this was in place..
There are assertions on all the other tests..
Let me know if there is a reason why we can't assert the results
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@FabioBatSilva technically you've combined a few separate changes in one PR?
@@ -7,7 +7,7 @@ EXTRAINCDIRS += $(TOP)/ | |||
EXTRAINCDIRS += $(HERE)/ | |||
|
|||
|
|||
CFLAGS += -O0 | |||
CFLAGS += -O1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gcc/ld doesn't like the inline functions on utils_math.c
utils_math.c:582: undefined reference to `utils_truncate_number'
error: ld returned 1 exit status
@vedderb this looks to be an amazing process improvement do you have time to move this forward? |
See also #167 |
Few things going on here:
You can see the pipeline running here:
https://github.com/FabioBatSilva/vesc-bldc/actions/runs/2184912510
FabioBatSilva#1
I believe actions is enable by default..
So it should run after this gets merged unless the configs for the repo have it disabled.
https://docs.github.com/en/enterprise-server@3.1/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#managing-github-actions-permissions-for-your-repository
see:
https://docs.github.com/en/actions