-
Notifications
You must be signed in to change notification settings - Fork 836
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
fatal error: gtest/gtest.h: No such file or directory #1026
Comments
The unit tests & test suite (gtest) I use isn't compatible with PlatformIOs Docs on how to run it (the unit tests) here: If you can figure out how to get it to work with PlatformIO I would be very grateful and happy. :) |
Thank you. I've followed the documentation and ran
(same error repeated on other lines in the same file) Maybe some difference in GCC versions? |
Could be. Every merge/PR that gets done to the library goes through a Travis check cycle which compiles and runs all the code & unit tests. FWIW on my machine:
|
Indeed. I'm using clang locally
, and doesn't like arrays whose dimensions are specified by non-const variables. Adding |
@egueli Thanks for that feedback and solution. Do you have a Or was it only that file? If so, I can probably find all occurances. |
Apple's c++ compiler (clang) has issues with array declarations using a variable. e.g. ``` error: variable-sized object may not be initialized ``` g++ doesn't seem to have an issue with it. Some unit tests used this, changing the variable to a constant fixes it. Fixes #1026
@egueli I've created PR #1027 to address the issue with Apple's standard compiler. As I don't have access to an Apple machine, Could you please download/test this branch (https://github.com/crankyoldgit/IRremoteESP8266/tree/Issue1026) and let me know if that fixes the unit tests for you? I used a regex to try to final all occurances in the code base for that sort of initialisation. I think I got them all. Fingers crossed. |
@crankyoldgit I tried your branch on my mac; tests build and run fine 💯 For the record, this is my diff you asked for: egueli@612deef (tests will fail as the branch isn't finished yet) Apparently, variable-length arrays are a GCC extension: https://gcc.gnu.org/onlinedocs/gcc/Variable-Length.html interesting that I read about them on SO just a few days ago :) I'll rebase my branch once your PR #1027 is merged. Cheers! |
Thanks. If it works, then I got them all! Thanks for confirming. |
Apple's c++ compiler (clang) has issues with array declarations using a variable. e.g. ``` error: variable-sized object may not be initialized ``` g++ doesn't seem to have an issue with it. Some unit tests used this, changing the variable to a constant fixes it. Fixes #1026
_v2.7.3 (20200130)_ **[Features]** - Allow protocols to be enabled or disabled with compiler flags. (#1013, #1012) - Panasonic AC: Add Ion Filter support for DKE models. (#1025, #1024) - Add support for sending Sony at 38Khz (#1029, #1018, #1019) - auto_analyse_raw_data.py: Handle analysing messages with no headers. (#1017) **[Misc]** - Fix Coolix unit test errors when using Apple c++ compiler. (#1030, #1028) - Fix Apple clang c++ compiler error in unit tests. (#1027, #1026) - Improve/fix scraping of supported devices (#1022) - Panasonic PKR series A/C uses DKE protocol. (#1020, #1021) - Update NEC supported devices. (#1018) - Add note to avoid GPIO16 on the ESP8266 for receiving. (#1016, #1015)
_v2.7.3 (20200130)_ **[Features]** - Allow protocols to be enabled or disabled with compiler flags. (#1013, #1012) - Panasonic AC: Add Ion Filter support for DKE models. (#1025, #1024) - Add support for sending Sony at 38Khz (#1029, #1018, #1019) - auto_analyse_raw_data.py: Handle analysing messages with no headers. (#1017) **[Misc]** - Fix Coolix unit test errors when using Apple c++ compiler. (#1030, #1028) - Fix Apple clang c++ compiler error in unit tests. (#1027, #1026) - Improve/fix scraping of supported devices (#1022) - Panasonic PKR series A/C uses DKE protocol. (#1020, #1021) - Update NEC supported devices. (#1018) - Add note to avoid GPIO16 on the ESP8266 for receiving. (#1016, #1015)
The code changes referenced above have been included in the v2.7.3 release of the library. |
Version/revision of the library used
v2.7.2
Expected behavior
cd test
make install-googletest
cd ..
pio test
Actual behavior
(same error repeats for other source files)
I have followed the steps in the Troubleshooting Guide & read the FAQ
Yes, but they don't talk about running unit tests.
Has this library/code previously worked as expected for you?
No: it's the first time I'm running the tests.
Other useful information
The build environment seems otherwise sane, i.e. I can
pio run
without issues.The text was updated successfully, but these errors were encountered: