Clear Filters
Clear Filters

Polyspace Test xUnit tests fails to compile: fatal error: gtest/gtest.h

7 views (last 30 days)
What parameter controls the C++ include file search path for my gtest test file?
Creating the project file with the python interface, I used (full python program listing attached):
This command attempts to build and run the test ( attached):
That path does not seem to be included into the command line that compiles my test program:
### Building Polyspace Test xUnit tests
### Building for host
### Building 'testbin_sil'
### Using toolchain: GNU gcc/g++ | gmake (64-bit Linux)
g++ -c -fwrapv -fPIC -O0 -DPSTEST_BUILD -DPST_USER_CONFIG_FILE -DPST_MAX_NB_PARAMS=31 -I/home/dgeorge/ws/fsw_drivers/cadence_spi -I/home/dgeorge/ws/fsw_drivers/cadence_spi/include -I/nix/store/33r3mf9k7h9f81pybwbhkqzbf9cycg3s-polyspace-installation-R2024a/extern/include -I/nix/store/33r3mf9k7h9f81pybwbhkqzbf9cycg3s-polyspace-installation-R2024a/toolbox/polyspace/pstest/services/driver/host/c -I/nix/store/33r3mf9k7h9f81pybwbhkqzbf9cycg3s-polyspace-installation-R2024a/polyspace/pstest/pstunit/include -I/nix/store/33r3mf9k7h9f81pybwbhkqzbf9cycg3s-polyspace-installation-R2024a/polyspace/pstest/pstunit/src -o "pstunit.o" "/nix/store/33r3mf9k7h9f81pybwbhkqzbf9cycg3s-polyspace-installation-R2024a/polyspace/pstest/pstunit/src/pstunit.cpp"
/home/dgeorge/ws/fsw_drivers/cadence_spi/test_cadence_spi.cpp:6:10: fatal error: gtest/gtest.h: No such file or directory
6 | #include <gtest/gtest.h>
| ^~~~~~~~~~~~~~
Invalid text character. Check for unsupported symbol, invisible character, or pasting of non-ASCII characters.
Project file snippet (project file attached):
"ExternalTestsOptions": {
"content": {
"IncludePaths": {
"content": {
"IncludePaths": [
"content": {
"Path": {
"content": {
"Value": "/nix/store/pqyrsjax8n0wb4dxap66pf6ix6qdz34a-gtest-1.12.1-dev/include"
Directory contents:
$ ls /nix/store/pqyrsjax8n0wb4dxap66pf6ix6qdz34a-gtest-1.12.1-dev/include/gtest
gtest-assertion-result.h gtest-matchers.h gtest-param-test.h gtest-spi.h gtest-typed-test.h gtest_pred_impl.h internal
gtest-death-test.h gtest-message.h gtest-printers.h gtest-test-part.h gtest.h gtest_prod.h
  1 Comment
Dan George
Dan George on 14 Apr 2024
The "workaround" is to put it into the plain buildConfig.IncludePaths. Perhaps this is not a workaround and is the proper placement.
What is the intended purpose of ExternalTestsBuildOptions?

Sign in to comment.

Answers (0)




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!