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

tests/CMakeLists: Use same dependencies as src/ #163

Merged
merged 5 commits into from
Jan 14, 2019

Conversation

ferdnyc
Copy link
Contributor

@ferdnyc ferdnyc commented Sep 17, 2018

tests/CMakeLists.txt needs to use the same method of incorporating system libraries (FFMpeg, jsoncpp) as src/CMakeLists.txt, or the tests fail (or fail to build). This change just cut-and-pastes the relevant parts of CMakeLists.txt from src/ to tests/, to prevent things like this happening:

With system FFMpeg:

[ 86%] Building CXX object tests/CMakeFiles/openshot-test.dir/Cache_Tests.cpp.o
cd /home/ferd/rpmbuild/REPOS/libopenshot/build2/tests && /usr/lib64/ccache/c++  -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -DOPENSHOT_IMAGEMAGICK_COMPATIBILITY=0 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIAWIDGETS_LIB -DQT_MULTIMEDIA_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DTEST_MEDIA_PATH=\"/home/ferd/rpmbuild/REPOS/libopenshot/src/examples/\" -DUSE_IMAGEMAGICK=1 -I/usr/include/UnitTest++ -I/usr/include/ImageMagick-6 -I/usr/include/libopenshot-audio -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtCore -isystem /usr/lib64/qt5/mkspecs/linux-g++ -isystem /usr/include/qt5/QtMultimedia -isystem /usr/include/qt5/QtNetwork -isystem /usr/include/qt5/QtMultimediaWidgets -I/home/ferd/rpmbuild/REPOS/libopenshot/tests/../thirdparty/jsoncpp/include  -std=c++11           -g -ggdb  -fopenmp    -fPIC -std=gnu++11 -o CMakeFiles/openshot-test.dir/Cache_Tests.cpp.o -c /home/ferd/rpmbuild/REPOS/libopenshot/tests/Cache_Tests.cpp
In file included from /home/ferd/rpmbuild/REPOS/libopenshot/tests/../include/ChannelLayouts.h:32,
                 from /home/ferd/rpmbuild/REPOS/libopenshot/tests/../include/Frame.h:60,
                 from /home/ferd/rpmbuild/REPOS/libopenshot/tests/../include/CacheBase.h:32,
                 from /home/ferd/rpmbuild/REPOS/libopenshot/tests/../include/CacheMemory.h:34,
                 from /home/ferd/rpmbuild/REPOS/libopenshot/tests/../include/ReaderBase.h:36,
                 from /home/ferd/rpmbuild/REPOS/libopenshot/tests/../include/AudioReaderSource.h:41,
                 from /home/ferd/rpmbuild/REPOS/libopenshot/tests/../include/OpenShot.h:100,
                 from /home/ferd/rpmbuild/REPOS/libopenshot/tests/Cache_Tests.cpp:29:
/home/ferd/rpmbuild/REPOS/libopenshot/tests/../include/FFmpegUtilities.h:43:12: fatal error: libavcodec/avcodec.h: No such file or directory
   #include <libavcodec/avcodec.h>
            ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

libopenshot linked with system jsoncpp:

$ tests/openshot-test 
----------------------------
     RUNNING ALL TESTS
----------------------------
/home/ferd/rpmbuild/REPOS/libopenshot/tests/Clip_Tests.cpp:95:1: error: Failure in Clip_Properties: Unhandled exception: test crashed
[libvpx @ 0x1b39480] v1.7.0
[libvorbis @ 0x1bedc80] 31 frames left in the queue on closing
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
FAILURE: 1 out of 78 tests failed (1 failures).
Test time: 4.37 seconds.
----------------------------

Fixes #175

@ferdnyc ferdnyc changed the title tests/CMakeFiles: Use FFMpeg like src/ does tests/CMakeLists: Use FFMpeg like src/ does Sep 17, 2018
The tests/ build needs to use the same jsoncpp as the src/ build,
or tests in Clip_Tests.cpp can fail.
@ferdnyc
Copy link
Contributor Author

ferdnyc commented Sep 17, 2018

Ditto the system jsoncpp, if used. I just pushed a commit to add that switch to tests/CMakeLists.txt as well.

@ferdnyc ferdnyc changed the title tests/CMakeLists: Use FFMpeg like src/ does tests/CMakeLists: Use same dependencies as src/ Sep 17, 2018
Displaying the version-number messages twice seems like overkill
@jonoomph
Copy link
Member

LG! 👍

@jonoomph jonoomph merged commit a49979e into OpenShot:develop Jan 14, 2019
@ferdnyc ferdnyc deleted the test-includes branch January 21, 2019 07:19
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

Successfully merging this pull request may close these issues.

2 participants