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

Please explain in README how to run tests #257

Closed
yurivict opened this issue Jun 20, 2022 · 4 comments
Closed

Please explain in README how to run tests #257

yurivict opened this issue Jun 20, 2022 · 4 comments

Comments

@yurivict
Copy link

When BUILD_TESTS=ON it only builds the test executable but there is no test target.

When I run the ezc3d_test executable many tests fail:

[ RUN      ] c3dFileIO.readC3DWithRotation
unknown file: Failure
C++ exception with description "Could not open the c3d file: unspecified iostream_category error" thrown in the test body.
[  FAILED  ] c3dFileIO.readC3DWithRotation (0 ms)
[ RUN      ] c3dFileIO.readViconC3D
unknown file: Failure
C++ exception with description "Could not open the c3d file: unspecified iostream_category error" thrown in the test body.
[  FAILED  ] c3dFileIO.readViconC3D (0 ms)
[ RUN      ] c3dFileIO.readQualisysC3D
unknown file: Failure
C++ exception with description "Could not open the c3d file: unspecified iostream_category error" thrown in the test body.
[  FAILED  ] c3dFileIO.readQualisysC3D (0 ms)
[ RUN      ] c3dFileIO.readOptotrakC3D
unknown file: Failure
C++ exception with description "Could not open the c3d file: unspecified iostream_category error" thrown in the test body.
[  FAILED  ] c3dFileIO.readOptotrakC3D (0 ms)
[ RUN      ] c3dFileIO.comparedIdenticalFilesSample1
unknown file: Failure
C++ exception with description "Could not open the c3d file: unspecified iostream_category error" thrown in the test body.
@pariterre
Copy link
Member

Are you on Windows or on a UNIX os?

@yurivict
Copy link
Author

I am on UNIX (FreeBSD).

@pariterre
Copy link
Member

Hi @yurivict
So, for myself, running the tests is basically compile and the run the ezc3d_test file as such:
From the root ezc3d folder:

mkdir build
cd build
cmake . .. -DBUILD_TESTS=ON
make
cd test
./ezc3d_test

That said, the tests you pointed that failed are some reading tests which necessitate actual c3d files. Do you see these files in the test folder? They should have been downloaded by CMake and moved to the build/test folder. If they haven't I suspect that the move command failed...

For the python tests, it goes the same. The tests must be ran from the build folder. So either you should copy the python test file or run pytest as suggested in the .appveyor.yml file:
pytest -v ../test/python3

Please confirm that this helps, if so, I will add this to the ReadMe :)

@yurivict
Copy link
Author

Tests weren't run from the test subdirectory. Now they run fine.

Thank you for your help!

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