test harness does not run on CMake builds
CMake builds executables in two directories build/src and build/samples. The test harness uses the environment string EXIV2_BINDIR to locate executables.
I build with CMake as follows:
$ cd exiv2
$ mkdir build ; pushd build ; cmake .. ; make ; popd
$ pushd build/samples # copy the sampes executables to src bin
$ for i in $(ls -1 | egrep -v \\. | egrep -v Make); do cp $i ../src ; done
$ cd test
$ make test EXIV2_BINDIR=$PWD/../build/src
There are a couple of possible fixes:
1) Modify the test suite to respect EXIV2_PATH= colon separated directory search path
2) Modify the CMake code to build the samples into src (or copy them once they are built)
I prefer solution 1. Volker made a very nice job of adding the EXIV2_BINDIR feature to the test suite. I'd like to see the "common" code in the test shell scripts put into "library.so" and sourced into the scripts.
Issue: #850. test scripts refactored. Common code collected into functions.source. Thanks to Shawn for his contribution.
Updated by Robin Mills about 9 years ago
- Category set to testing
- Target version set to 0.24
- % Done changed from 0 to 80
Fix submitted: SVN#2935. Thanks to Shawn for his contribution to this effort.
The test scripts have been refactored. All bash functions have been put into functions.source and included into the test scripts with "source functions.source" at the start of each script. functions.source includes new functions such as 'runTest' 'copyTestFile' 'copyTestFiles' and 'prepareTest'.
I've tried to reduce every script to the code that is unique to that script and leave the house keeping details to functions.source.
More simplification concerning result and difference analysis is possible.
The test script 'crw-test.sh' remains unchanged. It requires the program 'crwparse' (<exiv2-dir>/src/crwparse.cpp) which isn't build. crwparse.cpp should be moved to <exiv2-dir>/samples. Attempts to build crwparse caused linker errors. I'm not going to do anything concerning about crwparse as this is off topic.
I'd like very much to thank Shawn in China for his contribution to this issue. Shawn has just joined the team and it's a tough challenge to work remotely with an old Scotsman in English! Thanks Shawn for making the effort and working on this with me.