/build/bin** | All Platforms | Locatation of built binary object (exiv2.exe) |
+| EXIV2_EXT | **.exe** | msvc
Cygwin
Msys
MinGW | Extension used by executable binaries |
+| EXIV2_EXT | _**not set**_ | Linux
macOS
Unix| |
+| EXIV2_ECHO | _**not set**_ | All Platforms | For debugging Bash scripts |
+| VALGRIND | _**not set**_ | All Platforms | For debugging Bash scripts |
@@ -753,15 +771,21 @@ $ make tests
Summary report
```
-You can run individual tests in the test directory using the environment variable EXIV2\_BINDIR to specify the location of the build artifacts. For Cygwin and MinGW/msys builds, also set EXIV2_EXT=.exe
+You can run individual tests in the `test` directory using the environment variable EXIV2\_BINDIR to specify the location of the build artifacts. For Windows builds (msvc, Cygwin, Msys, MinGW), set EXIV2_EXT=.exe
```bash
-rmills@rmillsmbp-w7 ~/gnu/github/exiv2/exiv2/build $ cd ../test
-rmills@rmillsmbp-w7 ~/gnu/github/exiv2/exiv2/test $ env EXIV2_BINDIR=${PWD}/../build/bin ./icc-test.sh
+$ cd /build
+$ cd ../test
+$ env EXIV2_BINDIR=${PWD}/../build/bin ./icc-test.sh
ICC jpg md5 webp md5 png md5 jpg md5
all testcases passed.
-rmills@rmillsmbp-w7 ~/gnu/github/exiv2/exiv2/test $ env EXIV2_BINDIR=${PWD}/../build/bin make newtests
+$ env EXIV2_BINDIR=${PWD}/../build/bin make newtests
+... lots of output ...
+test_run (tiff_test.test_tiff_test_program.TestTiffTestProg) ... ok
+----------------------------------------------------------------------
+Ran 176 tests in 9.526s
+OK (skipped=6)
```
[TOC](#TOC)
@@ -779,9 +803,13 @@ $ 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 the python.exe program:_
-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:
+```
+..> copy c:\Python37\python.exe c:\Python37\python3.exe
+```
+
+Once you have modified the PATH and exported EXIV2\_BINDIR and EXIV2\_EXT, you can execute the test suite as described for UNIX-like systems:
```bash
$ cd /test
@@ -795,16 +823,7 @@ $ ./icc-test.sh
### 4.3 Unit tests
-The code for the unit tests is in `/unitTests`
-
-To build the unit tests, use the *cmake* option `-DEXIV2_BUILD_UNIT_TESTS=ON`.
-
-To execute the unit tests:
-
-```bash
-$ cd /build
-$ bin/unit_tests
-```
+The code for the unit tests is in `/unitTests`. To include unit tests in the build, use the *cmake* option `-DEXIV2_BUILD_UNIT_TESTS=ON`.
There is a discussion on the web about installing GTest: [https://github.com/Exiv2/exiv2/issues/575](https://github.com/Exiv2/exiv2/issues/575)
@@ -1054,4 +1073,4 @@ $ sudo pkg install developer/gcc-7
[TOC](#TOC)
-Written by Robin Mills
robin@clanmills.com
Updated: 2020-04-16
+Written by Robin Mills
robin@clanmills.com
Updated: 2020-04-18
diff --git a/src/exiv2.cpp b/src/exiv2.cpp
index ce3fb5ec..a7c542ec 100644
--- a/src/exiv2.cpp
+++ b/src/exiv2.cpp
@@ -222,7 +222,7 @@ void Params::cleanup()
void Params::version(bool verbose,std::ostream& os) const
{
os << EXV_PACKAGE_STRING << std::endl;
- if ( Params::instance().greps_.empty() ) {
+ if ( Params::instance().greps_.empty() && !verbose) {
os << "\n"
<< _("This program is free software; you can redistribute it and/or\n"
"modify it under the terms of the GNU General Public License\n"
diff --git a/test/Makefile b/test/Makefile
index e706f80b..88b0b134 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -133,48 +133,45 @@ xmpparser-test:
@echo ---- Running test: $@.sh ----
@echo
./$@.sh
-
-tests:
- cd .. ; make tests
-unixtests:
- cd .. ; make unixtests
+version_test \
+unit_test \
+test \
+tests:
+ @./$@.sh
-test:
+alltest:
@echo
- @echo ---- Running tests: ALL ----
+ @echo ---- Running bash tests: ALL ----
@echo
mkdir -p tmp
@rm -rf tmp/test-failed
- @list='$(TESTS1) $(TESTS2) version-test.sh'; for p in $$list; do \
+ @list='$(TESTS1) $(TESTS2)'; 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 ---- Running bash tests: UNIX subset ----
@echo
mkdir -p tmp
@rm -rf tmp/test-failed
- @list='$(TESTS1) version-test.sh'; for p in $$list; do \
+ @list='$(TESTS1)'; 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
newtests:
( cd ../tests ; python3 runner.py --verbose )
+
testv:
@for t in /video ; do \
if [ ! -e data/$$t ]; then \
diff --git a/test/functions.source b/test/functions.source
index f81a50ee..2a3a3268 100644
--- a/test/functions.source
+++ b/test/functions.source
@@ -10,8 +10,8 @@ runTest()
cd $here/tmp
if [ ! -z $EXIV2_ECHO ]; then
echoTest $VALGRIND $bin$prog "$@"
- fi
- $VALGRIND $bin$prog$exe "$@"
+ fi
+ $VALGRIND $bin$prog$exe "$@"
)
}
diff --git a/test/version-test.sh b/test/version-test.sh
deleted file mode 100755
index cdf92ee1..00000000
--- a/test/version-test.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/usr/bin/env bash
-# Test driver for exiv2.exe --verbose --version
-
-source ./functions.source
-
-( cd "$testdir"
- runTest exiv2 --verbose --version
-)
-
-# That's all Folks!
-##
diff --git a/test/version_test.sh b/test/version_test.sh
new file mode 100755
index 00000000..c9b3cea7
--- /dev/null
+++ b/test/version_test.sh
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+# Test driver for exiv2.exe --verbose --version
+
+source ./functions.source
+
+( cd "$testdir"
+ runTest exiv2 --verbose --version | grep -v -e ^xmlns
+ echo xmlns entry count: $(runTest exiv2 --verbose --version | grep -e ^xmlns | wc -l)
+)
+
+# That's all Folks!
+##