フィルターのクリア

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

13 ビュー (過去 30 日間)
Dan George
Dan George 2024 年 4 月 14 日
コメント済み: Dan George 2024 年 4 月 14 日
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):
buildConf.ExternalTestsBuildOptions.IncludePaths.add("/nix/store/pqyrsjax8n0wb4dxap66pf6ix6qdz34a-gtest-1.12.1-dev/include/")
This command attempts to build and run the test (mkproj.py attached):
python mkproj.py
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 件のコメント
Dan George
Dan George 2024 年 4 月 14 日
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?

サインインしてコメントする。

回答 (0 件)

製品


リリース

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by