Closed janusw closed 5 years ago
Looking at Testing/Temporary/LastTest.log
in my build directory, I see:
25/48 Testing: OCAFExportTestSuite.testExportAscii
25/48 Test: OCAFExportTestSuite.testExportAscii
Command: "/home/janus/OCE/oce/build_0.18/test/OCAFExport_test/OCAFExport_test" "--gtest_filter=OCAFExportTestSuite.testExportAscii"
Directory: /home/janus/OCE/oce/build_0.18/test/OCAFExport_test
"OCAFExportTestSuite.testExportAscii" start time: Jul 20 09:53 CEST
Output:
----------------------------------------------------------
Note: Google Test filter = OCAFExportTestSuite.testExportAscii
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from OCAFExportTestSuite
[ RUN ] OCAFExportTestSuite.testExportAscii
could not open: TKBin ; reason: libTKBin.so.11: cannot open shared object file: No such file or directory
/home/janus/OCE/oce/test/OCAFExport_test/OCAFExport_test.cpp:22: Failure
Value of: file.Exists()
Actual: false
Expected: true
[ FAILED ] OCAFExportTestSuite.testExportAscii (2 ms)
[----------] 1 test from OCAFExportTestSuite (2 ms total)
[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (2 ms total)
[ PASSED ] 0 tests.
[ FAILED ] 1 test, listed below:
[ FAILED ] OCAFExportTestSuite.testExportAscii
1 FAILED TEST
<end of output>
Test time = 0.02 sec
----------------------------------------------------------
Test Failed.
"OCAFExportTestSuite.testExportAscii" end time: Jul 20 09:53 CEST
"OCAFExportTestSuite.testExportAscii" time elapsed: 00:00:00
----------------------------------------------------------
26/48 Testing: OCAFExportTestSuite.testExportNonAscii
26/48 Test: OCAFExportTestSuite.testExportNonAscii
Command: "/home/janus/OCE/oce/build_0.18/test/OCAFExport_test/OCAFExport_test" "--gtest_filter=OCAFExportTestSuite.testExportNonAscii"
Directory: /home/janus/OCE/oce/build_0.18/test/OCAFExport_test
"OCAFExportTestSuite.testExportNonAscii" start time: Jul 20 09:53 CEST
Output:
----------------------------------------------------------
Note: Google Test filter = OCAFExportTestSuite.testExportNonAscii
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from OCAFExportTestSuite
[ RUN ] OCAFExportTestSuite.testExportNonAscii
could not open: TKBin ; reason: libTKBin.so.11: cannot open shared object file: No such file or directory
/home/janus/OCE/oce/test/OCAFExport_test/OCAFExport_test.cpp:44: Failure
Value of: file.Exists()
Actual: false
Expected: true
[ FAILED ] OCAFExportTestSuite.testExportNonAscii (1 ms)
[----------] 1 test from OCAFExportTestSuite (1 ms total)
[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (1 ms total)
[ PASSED ] 0 tests.
[ FAILED ] 1 test, listed below:
[ FAILED ] OCAFExportTestSuite.testExportNonAscii
1 FAILED TEST
<end of output>
Test time = 0.01 sec
----------------------------------------------------------
Test Failed.
"OCAFExportTestSuite.testExportNonAscii" end time: Jul 20 09:53 CEST
"OCAFExportTestSuite.testExportNonAscii" time elapsed: 00:00:00
----------------------------------------------------------
The crucial part is obviously:
could not open: TKBin ; reason: libTKBin.so.11: cannot open shared object file: No such file or directory
Actually the errors seem to go away after doing make install
.
I also verified that the build folder does contain the following files:
./Unix/x86_64-Release-64/libTKBin.so
./Unix/x86_64-Release-64/libTKBin.so.11
./Unix/x86_64-Release-64/libTKBin.so.11.0.0
but apparently those are not found during testing.
Possibly related to #381?
Although the OCAFExport_test
executable is supposed to be linked to libTKBin
, ldd does not actually show such a dependency.
One way to fix the testsuite failures (without make install
) seems to be to set LD_LIBRARY_PATH in the test environment:
diff --git a/test/OCAFExport_test/CMakeLists.txt b/test/OCAFExport_test/CMakeLists.txt
index f81798a3a..8d9f6ad86 100644
--- a/test/OCAFExport_test/CMakeLists.txt
+++ b/test/OCAFExport_test/CMakeLists.txt
@@ -5,6 +5,6 @@ if (OCE_OCAF AND NOT OCE_DISABLE_X11)
file(TO_NATIVE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../src/StdResource" BuildPluginDir)
# Semi-colon is a delimiter in SET_TESTS_PROPERTIES and have to be escaped
string(REPLACE ";" "\\;" BuildPluginDir "${BuildPluginDir}")
- set_tests_properties(OCAFExportTestSuite.testExportAscii PROPERTIES ENVIRONMENT "CSF_PluginDefaults=${BuildPluginDir};CSF_StandardDefaults=${BuildPluginDir}")
- set_tests_properties(OCAFExportTestSuite.testExportNonAscii PROPERTIES ENVIRONMENT "CSF_PluginDefaults=${BuildPluginDir};CSF_StandardDefaults=${BuildPluginDir}")
+ set_tests_properties(OCAFExportTestSuite.testExportAscii PROPERTIES ENVIRONMENT "CSF_PluginDefaults=${BuildPluginDir};CSF_StandardDefaults=${BuildPluginDir};LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}:${LIBRARY_OUTPUT_PATH}")
+ set_tests_properties(OCAFExportTestSuite.testExportNonAscii PROPERTIES ENVIRONMENT "CSF_PluginDefaults=${BuildPluginDir};CSF_StandardDefaults=${BuildPluginDir};LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}:${LIBRARY_OUTPUT_PATH}")
endif ()
Alternatively one could try to fix it via the RPATH, e.g. something like: set(CMAKE_BUILD_RPATH ${LIBRARY_OUTPUT_PATH})
However, I did not actually get this to work.
When building OCE 0.18.3 with -DOCE_TESTING=ON on Ubuntu 18.04 (using cmake 3.10, gcc 7.3, glibc 2.27), I see the following two test failures:
This does not happen on Ubuntu 16.04 (and I don't remember seeing it on 17.10 either, but I'm not sure about this).