Merge branch '0.27-maintenance' into 0.27.3-RC1

This commit is contained in:
Robin Mills 2020-04-16 19:55:12 +01:00 committed by GitHub
commit 2d57901d87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 317 additions and 100 deletions

View File

@ -82,11 +82,17 @@ if( EXIV2_BUILD_UNIT_TESTS )
add_subdirectory ( unitTests )
endif()
# Run a reduced test suite on UNIX #902
set (TEST test)
if ( CMAKE_HOST_SOLARIS OR CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" )
set (TEST unixtest)
endif()
if( EXIV2_BUILD_SAMPLES )
##
# tests
add_custom_target(tests
COMMAND env EXIV2_BINDIR="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" make test
COMMAND env EXIV2_BINDIR="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" make ${TEST}
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/test"
)
add_subdirectory( samples )

101
README.md
View File

@ -120,10 +120,10 @@ Options defined by <exiv2>/CMakeLists.txt include:
```bash
576 rmills@rmillsmm:~/gnu/github/exiv2/exiv2 $ grep ^option CMakeLists.txt
option( BUILD_SHARED_LIBS "Build exiv2lib as a shared library" ON )
option( EXIV2_ENABLE_XMP "Build with XMP metadata support" ON )
option( EXIV2_ENABLE_EXTERNAL_XMP "Use external version of XMP" OFF )
option( EXIV2_ENABLE_PNG "Build with png support (requires libz)" ON )
option( BUILD_SHARED_LIBS "Build exiv2lib as a shared library" ON )
option( EXIV2_ENABLE_XMP "Build with XMP metadata support" ON )
option( EXIV2_ENABLE_EXTERNAL_XMP "Use external version of XMP" OFF )
option( EXIV2_ENABLE_PNG "Build with png support (requires libz)" ON )
...
577 rmills@rmillsmm:~/gnu/github/exiv2/exiv2 $
```
@ -779,7 +779,7 @@ $ export EXIV2_EXT=.exe
$ export EXIV2_BINDIR=${PWD}/../build/bin
```
**Caution: ** The python3 interpreter must be for DOS and called python3.exe. I copied `c:\Python37\python.exe c:\Python37\python3.exe`
**Caution: ** _The python3 interpreter must be for DOS and called python3.exe. I copied `c:\Python37\python.exe c:\Python37\python3.exe`__
Once you have modified the PATH and and exported EXIV2\_BINDIR and EXIV2\_EXT, you can execute the test suite as described for UNIX-like systems:
@ -956,9 +956,8 @@ I use the following batch file to start cmd.exe. I do this to reduce the comple
```bat
@echo off
setlocal
cd %HOMEPATH%
set "PATH=C:\Python37\;C:\Python27\;C:\Python27\Scripts;C:\Perl64\site\bin;C:\Perl64\bin;C:\WINDOWS\system32;C:\Program Files\Git\cmd;C:\Program Files\Git\usr\bin;c:\Program Files\cmake\bin;"
cmd
set "PATH=C:\Python37\;C:\Python37\Scripts;C:\Perl64\site\bin;C:\Perl64\bin;C:\WINDOWS\system32;C:\Program Files\Git\cmd;C:\Program Files\Git\usr\bin;c:\Program Files\cmake\bin;c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin"
cmd /S /K cd %HOMEDRIVE%%HOMEPATH%
```
[TOC](#TOC)
@ -966,51 +965,93 @@ cmd
### 5.6 Unix
Exiv2 can be built on many Unix and Linux distros. With v0.27.2, we are starting to actively support the Unix Distributions NetBSD and FreeBSD. We hope to add CI support for these platforms in v0.27.3.
Exiv2 can be built on many Unix and Linux distros. With v0.27.2, we are starting to actively support the Unix Distributions NetBSD and FreeBSD. For v0.27.3, I have added support for Solaris 11.4
I have provided notes here based on my experience with these platforms. Feedback is welcome.
We do not have CI support for these platforms on GitHub. However, I regularly build and test them on my MacMini Buildserver. The device is private and not on the internet.
I am willing to support Exiv2 on other commercial Unix distributions such as AIX, HP-UX and OSF/1 if you provide with an ssh account for your platform. I will require super-user privileges to install software.
I have provided notes here based on my experience with these platforms. Feedback is welcome. I am willing to support Exiv2 on other commercial Unix distributions such as AIX, HP-UX and OSF/1 if you provide with an ssh account for your platform. I will require super-user privileges to install software.
**Caution:** _There are issues with the bash test suite on UNIX as the utility `diff` has different command syntax. While most of the test suite operates successfully, several tests require more investigation. I am confident that this issues are in the test suite and not in exiv2.__
For all platforms you will need the following components to build:
1. gcc or clang
2. cmake
3. bash
4. sudo
5. gettext
To run the test suite, you need:
1. python3
2. chksum
3. dos2unix
4. xmllint
#### NetBSD
You can build exiv2 from source using the methods described for linux. I built and installed exiv2 using "Pure CMake" and didn't require conan.
You will want to use the package manager `pkgsrc` to build/install:
1. gcc (currently GCC 5.5.0)
2. python3
3. cmake
4. bash
5. sudo
6. chksum
7. gettext
You will want to use the package manager `pkgsrc` to build/install the build and test components listed above.
I entered links into the file system `# ln -s /usr/pkg/bin/python37 /usr/local/bin/python3` and `# ln -s /usr/pkg/bin/bash /bin/bash`
It's important to ensure that `LD_LIBRARY_PATH` includes `/usr/local/lib` and `/usr/pkg/lib`. It's important to ensure that PATH includes `/usr/local/bin`, `/usr/pkg/bin` and `/usr/pkg/sbin`.
I entered links into the file system
```
# ln -s /usr/pkg/bin/python37 /usr/local/bin/python3
# ln -s /usr/pkg/bin/bash /bin/bash`
```
It's important to ensure that `LD_LIBRARY_PATH` includes `/usr/local/lib` and `/usr/pkg/lib`.
It's important to ensure that `PATH` includes `/usr/local/bin`, `/usr/pkg/bin` and `/usr/pkg/sbin`.
#### FreeBSD
Clang is pre-installed as ``/usr/bin/{cc|c++}` as well has libz and expat. FreeBSD uses pkg as the package manager which I used to install cmake and git.
Clang is pre-installed as ``/usr/bin/{cc|c++}` as well as libz and expat. FreeBSD uses pkg as the package manager which I used to install cmake and git.
```bash
$ su root
Password:
# pkg install cmake
# pkg install git
```
To run the Exiv2 test suite, I installed bash and python. The test suite requires additional work as the platform `diff` command does not understand the option `--binary` and returns an error. In consequence, the test harness returns lots of errors. I hope to address this in v0.27.3.
```bash
# pkg install bash
# pkg install python
```
**Caution**: _The package manager *pkg* is no longer working on FreeBSD 12.0. I will move to 12.1 for future work. Others have reported this issue on 12.1. Broken package manager is very bad news. There are other package managers (such as ports), however installing and getting it to work is formidable._
```
634 rmills@rmillsmm-freebsd:~/gnu/github/exiv2/0.27-maintenance/build $ sudo pkg install libxml2
Updating FreeBSD repository catalogue...
pkg: repository meta /var/db/pkg/FreeBSD.meta has wrong version 2
pkg: Repository FreeBSD load error: meta cannot be loaded No error: 0
Fetching meta.txz: 100% 916 B 0.9kB/s 00:01
pkg: repository meta /var/db/pkg/FreeBSD.meta has wrong version 2
repository FreeBSD has no meta file, using default settings
Fetching packagesite.txz: 100% 6 MiB 340.2kB/s 00:19
pkg: repository meta /var/db/pkg/FreeBSD.meta has wrong version 2
pkg: Repository FreeBSD load error: meta cannot be loaded No error: 0
Unable to open created repository FreeBSD
Unable to update repository FreeBSD
Error updating repositories!
635 rmills@rmillsmm-freebsd:~/gnu/github/exiv2/0.27-maintenance/build $
```
#### Solaris
Work in progress: [https://github.com/Exiv2/exiv2/issues/902](https://github.com/Exiv2/exiv2/issues/902)
Solaris uses the package manager pkg. To get a list of packages:
```bash
$ pkg list
```
To install a package:
```bash
$ sudo pkg install developer/gcc-7
```
[TOC](#TOC)
Written by Robin Mills<br>robin@clanmills.com<br>Updated: 2020-04-10
Written by Robin Mills<br>robin@clanmills.com<br>Updated: 2020-04-16

View File

@ -24,7 +24,7 @@ if ( MINGW OR UNIX OR MSYS ) # MINGW, Linux, APPLE, CYGWIN
if (COMPILER_IS_GCC OR COMPILER_IS_CLANG)
# This fails under Fedora - MinGW - Gcc 8.3
if (NOT MINGW)
if (NOT MINGW AND NOT CMAKE_HOST_SOLARIS)
if (COMPILER_IS_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)
add_compile_options(-fstack-clash-protection -fcf-protection)
endif()

View File

@ -41,14 +41,14 @@ elseif ( APPLE )
set (PACKDIR Darwin)
elseif ( LINUX )
set (PACKDIR Linux)
elseif ( CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" )
elseif ( CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_HOST_SOLARIS)
set (PACKDIR Unix)
else()
set (PACKDIR Linux) # Linux and unsupported systems
endif()
set (BUNDLE_NAME ${PACKDIR})
if ( CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" )
if ( CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_HOST_SOLARIS )
set (BUNDLE_NAME ${CMAKE_SYSTEM_NAME})
endif()
@ -120,13 +120,10 @@ foreach(doc ${DOCS})
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${doc} DESTINATION .)
endforeach()
# copy build/test logs which are only present on Jenkins builds
# copy build/log which which is present if built by build.sh
if(EXISTS ${PROJECT_SOURCE_DIR}/build/logs/build.txt)
install(FILES ${PROJECT_SOURCE_DIR}/build/logs/build.txt DESTINATION "logs")
endif()
if(EXISTS ${PROJECT_SOURCE_DIR}/build/logs/test.txt)
install(FILES ${PROJECT_SOURCE_DIR}/build/logs/test.txt DESTINATION "logs")
endif()
# Copy releasenotes.txt and appropriate ReadMe.txt (eg releasenotes/${PACKDIR}/ReadMe.txt)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/releasenotes/${PACKDIR}/ReadMe.txt ReadMe.txt @ONLY)

View File

@ -11,7 +11,7 @@ lib/pkgconfig/exiv2.pc pkg-config file
share/man/ man pages
share/locale/ localisation files
samples/exifprint.cpp sample code
logs build and test logs
logs build/test log
ReadMe.txt This file
exiv2.png Exiv2 Logo
@ -50,3 +50,19 @@ $ export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
$ g++ -std=gnu++98 samples/exifprint.cpp -o exifprint $(pkg-config exiv2 --libs --cflags)
$ ./exifprint
Method 3: Use the CMake support/consume files
See file: README.md Section: 2.6 "Consuming Exiv2 with CMake"
More Documentation
------------------
$ export "MANPATH=/usr/local/share/man:$MANPATH"
$ man exiv2
The following documents are included in your bundle:
README.md Developer Manual
README-CONAN.md Developer Manual Appendix
README-SAMPLES.md Developer Sample Code Manual

View File

@ -11,7 +11,7 @@ include/exiv2/ include files
share/man/ man pages
share/locale/ localisation files
samples/exifprint.cpp sample code
logs/ build and test logs
logs build/test log
ReadMe.txt This file
exiv2.png Exiv2 Logo
@ -49,3 +49,15 @@ $ ./exifprint
Method 3: Use the CMake support/consume files
See file: README.md Section: 2.6 "Consuming Exiv2 with CMake"
More Documentation
------------------
$ export "MANPATH=/usr/local/share/man:$MANPATH"
$ man exiv2
The following documents are included in your bundle:
README.md Developer Manual
README-CONAN.md Developer Manual Appendix
README-SAMPLES.md Developer Sample Code Manual

View File

@ -11,7 +11,7 @@ include/exiv2/ include files
share/man/ man pages
share/locale/ localisation files
samples/exifprint.cpp sample code
logs/ build and test logs
logs build/test log
ReadMe.txt This file
license.txt GPLv2.0 Software License
@ -53,3 +53,15 @@ $ ./exifprint --version
Method 3: Use the CMake support/consume files
See file: README.md Section: 2.6 "Consuming Exiv2 with CMake"
More Documentation
------------------
$ export "MANPATH=/usr/local/share/man:$MANPATH"
$ man exiv2
The following documents are included in your bundle:
README.md Developer Manual
README-CONAN.md Developer Manual Appendix
README-SAMPLES.md Developer Sample Code Manual

View File

@ -12,7 +12,7 @@ include/exiv2/ include files
share/man/ man pages
share/locale/ localisation files
samples/exifprint.cpp sample code
logs build and test logs
logs build/test log
ReadMe.txt This file
exiv2.png Exiv2 Logo
@ -52,3 +52,18 @@ $ export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"
$ export PATH="/usr/local/bin:$PATH"
$ g++ -std=c++98 samples/exifprint.cpp -o exifprint $(pkg-config exiv2 --libs --cflags)
$ ./exifprint --version
Method 3: Use the CMake support/consume files
See file: README.md Section: 2.6 "Consuming Exiv2 with CMake"
More Documentation
------------------
$ export "MANPATH=/usr/local/share/man:$MANPATH"
$ man exiv2
The following documents are included in your bundle:
README.md Developer Manual
README-CONAN.md Developer Manual Appendix
README-SAMPLES.md Developer Sample Code Manual

View File

@ -11,7 +11,7 @@ include/exiv2/ include files
share/man/ man pages
share/locale/ localisation files
samples/exifprint.cpp sample code
logs/ build and test logs
logs build/test log
ReadMe.txt This file
license.txt GPLv2.0 Software License
@ -53,3 +53,14 @@ $ ./exifprint
Method 3: Use the CMake support/consume files
See file: README.md Section: 2.6 "Consuming Exiv2 with CMake"
More Documentation
------------------
$ export "MANPATH=/usr/local/share/man:$MANPATH"
$ man exiv2
The following documents are included in your bundle:
README.md Developer Manual
README-CONAN.md Developer Manual Appendix
README-SAMPLES.md Developer Sample Code Manual

View File

@ -9,7 +9,7 @@ lib/exiv2.lib & exiv2-xmp.lib link libraries
lib/cmake/exiv2 CMake support/consume files
include/exiv2/ include files
samples/exifprint.cpp sample code
logs/ build and test logs
logs build/test log
ReadMe.txt This file
license.txt GPLv2.0 Software License
@ -45,3 +45,17 @@ c:\> cd <bundle>
<bundle>> cl /EHsc -Iinclude /MD samples\exifprint.cpp /link lib\exiv2.lib
<bundle>> exifprint --version
<bundle>>
Method 3: Use the CMake support/consume files
See file: README.md Section: 2.6 "Consuming Exiv2 with CMake"
More Documentation
------------------
https://www.exiv2.org/manpage.html
The following documents are included in your bundle:
README.md Developer Manual
README-CONAN.md Developer Manual Appendix
README-SAMPLES.md Developer Sample Code Manual

View File

@ -289,10 +289,10 @@ int main(int argc, char* const argv[])
Jzon::Object root;
if ( option == 'f' ) { // only report filesystem when requested
const char* FS="FS";
Jzon::Object fs ;
root.Add(FS,fs) ;
fileSystemPush(path,root.Get(FS));
const char* Fs="FS";
Jzon::Object fs ;
root.Add(Fs,fs) ;
fileSystemPush(path,root.Get(Fs));
}
if ( option == 'a' || option == 'e' ) {

View File

@ -223,13 +223,13 @@ std::string Position::toExifTimeStamp(std::string& t)
const char* arg = t.c_str();
int HH = 0 ;
int mm = 0 ;
int SS = 0 ;
int SS1 = 0 ;
if ( strstr(arg,":") || strstr(arg,"-") ) {
int YY,MM,DD ;
char a,b,c,d,e ;
sscanf(arg,"%d%c%d%c%d%c%d%c%d%c%d",&YY,&a,&MM,&b,&DD,&c,&HH,&d,&mm,&e,&SS);
sscanf(arg,"%d%c%d%c%d%c%d%c%d%c%d",&YY,&a,&MM,&b,&DD,&c,&HH,&d,&mm,&e,&SS1);
}
sprintf(result,"%d/1 %d/1 %d/1",HH,mm,SS);
sprintf(result,"%d/1 %d/1 %d/1",HH,mm,SS1);
return std::string(result);
}
@ -406,15 +406,15 @@ time_t parseTime(const char* arg,bool bAdjust)
// <time>2012-07-14T17:33:16Z</time>
if ( strstr(arg,":") || strstr(arg,"-") ) {
int YY,MM,DD,HH,mm,SS ;
int YY,MM,DD,HH,mm,SS1 ;
char a,b,c,d,e ;
sscanf(arg,"%d%c%d%c%d%c%d%c%d%c%d",&YY,&a,&MM,&b,&DD,&c,&HH,&d,&mm,&e,&SS);
sscanf(arg,"%d%c%d%c%d%c%d%c%d%c%d",&YY,&a,&MM,&b,&DD,&c,&HH,&d,&mm,&e,&SS1);
struct tm T;
memset(&T,0,sizeof(T));
T.tm_min = mm ;
T.tm_hour = HH ;
T.tm_sec = SS ;
T.tm_sec = SS1 ;
if ( bAdjust ) T.tm_sec -= Position::Adjust();
T.tm_year = YY -1900 ;
T.tm_mon = MM -1 ;
@ -441,7 +441,7 @@ int timeZoneAdjust()
struct tm lcopy = *localtime(&now);
time_t gmt = timegm(&lcopy) ; // timegm modifies lcopy
offset = (int) ( ((long signed int) gmt) - ((long signed int) now) ) ;
#elif defined(OS_SOLARIS)
#elif defined(OS_SOLARIS) || defined(__sun__)
struct tm local = *localtime(&now) ;
time_t local_tt = (int) mktime(&local);
time_t time_gmt = (int) mktime(gmtime(&now));

View File

@ -24,6 +24,7 @@
#include "futils.hpp"
#include "datasets.hpp"
#include "enforce.hpp"
#include "image_int.hpp"
// + standard includes
#include <sys/types.h>
@ -498,6 +499,15 @@ namespace Exiv2 {
// release resources
if ( procs ) procstat_freeprocs(procstat, procs);
if ( procstat ) procstat_close(procstat);
#elif defined(__sun__)
// https://stackoverflow.com/questions/47472762/on-solaris-how-to-get-the-full-path-of-executable-of-running-process-programatic
const char* proc = Internal::stringFormat("/proc/%d/path/a.out",getpid()).c_str();
char path[500];
ssize_t l = readlink (proc,path,sizeof(path)-1);
if (l>0) {
path[l]=0;
ret = path;
}
#elif defined(__unix__)
// http://stackoverflow.com/questions/606041/how-do-i-get-the-path-of-a-process-in-unix-linux
char path[500];

View File

@ -74,10 +74,11 @@
# include <sys/socket.h>
# include <sys/sysctl.h>
# include <libprocstat.h>
#elif defined(__sun__)
# include <dlfcn.h>
# include <link.h>
#endif
namespace Exiv2 {
int versionNumber()
{
@ -199,9 +200,22 @@ static Exiv2::StringVector getLoadedLibraries()
if ( files ) procstat_freefiles(procstat, files);
if ( procs ) procstat_freeprocs(procstat, procs);
if ( procstat ) procstat_close (procstat);
#elif defined (__sun__) || defined(__unix__)
// http://stackoverflow.com/questions/606041/how-do-i-get-the-path-of-a-process-in-unix-linux
char procsz[100];
char pathsz[500];
sprintf(procsz,"/proc/%d/path/a.out", getpid());
int l = readlink (procsz, pathsz,sizeof(pathsz));
if (l>0) {
pathsz[l]='\0';
path.assign(pathsz);
libs.push_back(path);
} else {
libs.push_back("unknown");
}
#elif defined(__unix__)
// read file /proc/self/maps which has a list of files in memory
// (this doesn't yield anything on __sun__)
std::ifstream maps("/proc/self/maps",std::ifstream::in);
std::string string ;
while ( std::getline(maps,string) ) {
@ -212,6 +226,8 @@ static Exiv2::StringVector getLoadedLibraries()
}
}
#endif
if ( !libs.size() ) libs.push_back("unknown");
return libs;
}
@ -260,14 +276,12 @@ void Exiv2::dumpLibraryInfo(std::ostream& os,const exv_grep_keys_t& keys)
"CC (oracle)";
#elif defined (__SUNPRO_C)
"cc (oracle)";
#elif defined (__sun__)
"cc (solaris)";
#else
"unknown" ;
#endif
#if defined(__SUNPRO_CC) || defined (__SUNPRO_C)
#define __oracle__
#endif
#ifndef __VERSION__
#ifdef __clang__version__
#define __VERSION__ __clang__version__
@ -289,6 +303,8 @@ void Exiv2::dumpLibraryInfo(std::ostream& os,const exv_grep_keys_t& keys)
"mingw64";
#elif defined(__MINGW32__)
"mingw32";
#elif defined(__sun__)
"solaris";
#elif defined(__NetBSD__)
"netbsd";
#elif defined(__FreeBSD__)

View File

@ -59,28 +59,43 @@ SHELL = /bin/sh
# to save download time for simple build/test, we download video and eps data on demand
SVN = svn://dev.exiv2.org/svn/testdata/trunk
# ## Sadly on SunOS make terminates saying "unexpected end of line"
# # determine the test platform
# UNAME := $(shell uname)
# UNIX=FALSE
# ifeq ($(UNAME),SunOS)
# UNIX=TRUE
# endif
# ifeq ($(UNAME),FreeBSD)
# UNIX=TRUE
# endif
##
# Add test drivers to this list
TESTS = addmoddel.sh \
TESTS1 = addmoddel.sh \
conversions.sh \
exifdata-test.sh \
exiv2-test.sh \
geotag-test.sh \
imagetest.sh \
icc-test.sh \
iotest.sh \
iptctest.sh \
iso65k-test.sh \
modify-test.sh \
path-test.sh \
preview-test.sh \
stringto-test.sh \
tiff-test.sh \
webp-test.sh \
write-test.sh \
write2-test.sh \
xmpparser-test.sh \
version-test.sh
# the following tests are broken on UNIX
# You can manually run all the tests: `cd <exiv2dir>/test ; env EXIV2_BINDIR=$PWD/../build/bin make test`
# You can manually run a single test: `cd <exiv2dir>/test ; env EXIV2_BINDIR=$PWD/../build/bin ./iotest.sh`
# Or: make iotest
TESTS2 = exifdata-test.sh \
exiv2-test.sh \
imagetest.sh \
iotest.sh \
iptctest.sh \
preview-test.sh \
tiff-test.sh \
write-test.sh \
xmpparser-test.sh
# video tests
TESTV = video-test.sh
@ -95,13 +110,59 @@ TESTX = httpiotest.sh \
curliotest.sh \
sshiotest.sh
addmoddel \
conversions \
geotag-test \
icc-test \
iso65k-test \
modify-test \
path-test \
stringto-test \
webp-test \
write2-test \
exifdata-test \
exiv2-test \
imagetest \
iotest \
iptctest \
preview-test \
tiff-test \
write-test \
xmpparser-test:
@echo
@echo ---- Running test: $@.sh ----
@echo
./$@.sh
tests:
cd .. ; make tests
unixtests:
cd .. ; make unixtests
test:
@echo
@echo ---- Running tests: ALL ----
@echo
mkdir -p tmp
rm -rf tmp/test-failed
@list='$(TESTS)'; for p in $$list; do \
@rm -rf tmp/test-failed
@list='$(TESTS1) $(TESTS2) version-test.sh'; for p in $$list; do \
echo Running $$p ...; \
./$$p; \
rc=$$?; \
if [ $$rc -ne 0 ]; then echo '***' ; echo '***' $$p result = $$rc ; echo '***' ; fi ; \
if [ $$rc -ne 0 ]; then echo '***' $$p result = $$rc >> tmp/test-failed ; fi ; \
done
make newtests
@if [ -e tmp/test-failed ]; then echo '***' FAILED ; cat tmp/test-failed ; echo '***' ; exit 255; fi
unixtest:
@echo
@echo ---- Running test: UNIX subset ----
@echo
mkdir -p tmp
@rm -rf tmp/test-failed
@list='$(TESTS1) version-test.sh'; for p in $$list; do \
echo Running $$p ...; \
./$$p; \
rc=$$?; \

View File

@ -10,7 +10,7 @@ source ./functions.source
runTest exifdata-test exiv2-canon-powershot-s40.jpg
runTest exifdata-test exiv2-nikon-d70.jpg
) | tr -d '\r' > $results
) | tr -d '\r' | sed 's/[ \t]+$//' > $results
reportTest

View File

@ -100,9 +100,9 @@ reportTest()
fi
if [ "$PLATFORM" == "cygwin" ]; then
diff -q $diffargs $(cygpath -aw $lhs) $(cygpath -aw $rhs)
diff $diffargs $(cygpath -aw $lhs) $(cygpath -aw $rhs)
else
diff -q $diffargs $lhs $rhs
diff $diffargs $lhs $rhs
fi
rc=$?
if [ $rc -eq 0 ] ; then
@ -226,7 +226,11 @@ diffCheck()
if [ -z "$errors" ]; then let -a errors=0; fi
#run diff and check results
diff -q --binary $diffargs "$test" "$good"
if [ $(uname) == FreeBSD -o $(uname) == NetBSD -o $(uname) == SunOS ]; then
bdiff $diffargs "$test" "$good"
else
diff --binary $diffargs "$test" "$good"
fi
if [ $? -ne 0 ]; then
errors=$(expr $errors + 1)
else
@ -487,29 +491,31 @@ prepareTest()
##
# figure out arguments for diff
diffargs="--strip-trailing-cr"
good="$here/data/${this}.out"
results="$here/tmp/${this}.out"
tmpfile=$here/tmp/$this
touch $tmpfile
diff -q $diffargs $tmpfile $tmpfile 2>/dev/null
if [ $? -ne 0 ]; then
diffargs=""
fi
tmpfile=tmp/ttt
good="$here/data/${this}.out"
results="$here/tmp/${this}.out"
tmpfile=$here/tmp/$this
touch $tmpfile
da1="--strip-trailing-cr"
diff -q $da1 $tmpfile $tmpfile 2>/dev/null
if [ $? -ne 0 ] ; then
da1=""
if [ "$PLATFORM" == SunOS -o "$PLATFORM" == FreeBSD -o "$PLATFORM" == NetBSD ] ; then
da1=""
da2=""
else
diffargs="--strip-trailing-cr"
diff -q $diffargs $tmpfile $tmpfile 2>/dev/null
if [ $? -ne 0 ]; then
diffargs=""
fi
tmpfile=tmp/ttt
touch $tmpfile
da1="--strip-trailing-cr"
diff -q $da1 $tmpfile $tmpfile 2>/dev/null
if [ $? -ne 0 ] ; then
da1=""
fi
da2="--ignore-matching-lines=^Usage:.*exiv2"
diff -q $da2 $tmpfile $tmpfile 2>/dev/null
fi
da2="--ignore-matching-lines=^Usage:.*exiv2"
diff -q $da2 $tmpfile $tmpfile 2>/dev/null
#if [ $? -ne 0 -o "$PLATFORM" == mingw ] ; then
# da2=""
#fi
diffargs="$da1 $da2"
##