Skip to content
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

PIO Core 6.1.17 brakes unit testing with googletest #5091

Open
TeamPlatinum1 opened this issue Feb 16, 2025 · 0 comments
Open

PIO Core 6.1.17 brakes unit testing with googletest #5091

TeamPlatinum1 opened this issue Feb 16, 2025 · 0 comments
Milestone

Comments

@TeamPlatinum1
Copy link

Hi everyone, first I would like to thank you for your work on this project.

After the upgrade to PIO Core 6.1.17 the testing fails in the build stage and throws this error:

.pio/libdeps/native/googletest/googletest/src/gtest-filepath.cc: In static member function ‘static testing::internal::FilePath testing::internal::FilePath::GetCurrentDir()’:
.pio/libdeps/native/googletest/googletest/src/gtest-filepath.cc:60:25: error: ‘_POSIX_PATH_MAX’ was not declared in this scope; did you mean ‘_PC_PATH_MAX’?
   60 | #define GTEST_PATH_MAX_ _POSIX_PATH_MAX
      |                         ^~~~~~~~~~~~~~~
.pio/libdeps/native/googletest/googletest/src/gtest-filepath.cc:114:12: note: in expansion of macro ‘GTEST_PATH_MAX_’
  114 |   char cwd[GTEST_PATH_MAX_ + 1] = {'\0'};
      |            ^~~~~~~~~~~~~~~
.pio/libdeps/native/googletest/googletest/src/gtest-filepath.cc:115:25: error: ‘cwd’ was not declared in this scope
  115 |   char* result = getcwd(cwd, sizeof(cwd));
      |                         ^~~
*** [.pio/build/native/lib109/googletest/googletest/src/gtest-filepath.o] Error 1
Building stage has failed, see errors above. Use `pio test -vvv` option to enable verbose output.
--------------- native:test_native [ERRORED] Took 36.92 seconds ---------------

The .ini file looks like this:

[env:teensy40]
platform = teensy
board = teensy40
framework = arduino
build_flags = -Ofast
test_ignore = test_native
lib_extra_dirs = lib/custom, lib/public, lib/inbuilt, lib/edited
monitor_speed = 115200

[env:native]
platform = native
test_framework = googletest
build_flags = -D NATIVE
lib_compat_mode = off
lib_extra_dirs = lib/custom, lib/public
lib_deps = google/googletest@1.15.2

After downgrading to 6.1.16 everything works as expected. Let me know if I should provide more info.

@ivankravets ivankravets added this to the 6.1.18 milestone Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants