Project

General

Profile

How do I run the test suite for Exiv2 » History » Version 4

Robin Mills, 09 Mar 2015 10:36

1 1 Robin Mills
h1. How do I run the test suite for Exiv2
2
3
You can run the test suite on MacOSX, Linux and Windows.  To run on Windows, you will need to install Cygwin because the test suite is written as Bash scripts.  You can run the test suite on Cygwin on exiv2 built with MSVC, Cygwin or MinGW.
4
5 4 Robin Mills
For *nix builds (Mac/Cygwin/Linux), in the topmost directory use the following commands:
6
<pre>
7
$ cd <exiv2dir>
8
$ make config
9
$ ./configure
10
$ make
11
$ sudo make install
12
$ make samples
13
$ make tests
14
</pre>
15
For users who prefer to use CMake:
16
<pre>
17
$ cd <exiv2dir>
18
$ rmdir ../build
19
$ mkdir ../build
20
$ cd ../build
21
$ cmake <exiv2dir> -G "Unix Makefiles"
22
$ make
23
$ make tests
24
</pre> 
25
There are a few things which may cause you difficulty.  You need the utility pkg-config to build the samples.  Here are some additional notes. 
26 1 Robin Mills
<pre>
27
$ cd <exiv2dir>
28 3 Robin Mills
TAKE CARE: If you build with ./configure; make - you will need to build the samples to run the test suite
29
TAKE CARE: If you build with ./configure; make - you will need the utility pkg-config to build the samples
30
TAKE CARE: Users of CMake/msvc64/msvc have the samples built automatically
31 1 Robin Mills
$ make tests          # This tests most exiv2 capability
32
.....
33
$ make teste          # This tests EPS functionality (downloads and caches 20mb of test data)
34
....
35
$ make testv          # This tests Video functionality (downloads and caches 50mb of test data)
36
...
37
</pre>For MSVC and MSVC64 builds, please define the environment string EXIV2_BINDIR to be the name of the directory in which exiv2.exe (and other applications) are built:
38
<pre>$  make tests EXIV2_BINDIR=$PWD/msvc64/bin/Win32/ReleaseDLL</pre>Take care, Cygwin is case sensitive about path/filenames.
39
40
On Mac/Linux, the suite runs in about 1 minute. On Cygwin, it's about 5 minutes.
41
42
You can run the tests individually from the <exiv2dir>/test directory:<pre>
43
1013 rmills@rmills-linux:~/gnu/exiv2/test.build/test $ ls *.sh
44 2 Robin Mills
addmoddel.sh      crw-test.sh    exiv2-test.sh   iptctest.sh
45
preview-test.sh   tiff-test.sh   write2-test.sh  bugfixes-test.sh
46
eps-test.sh       imagetest.sh   modify-test.sh  stringto-test.sh
47
verifyMSVC.sh     write-test.sh  conversions.sh  exifdata-test.sh
48
iotest.sh         path-test.sh   testMSVC.sh     video-test.sh
49
xmpparser-test.sh
50
51 1 Robin Mills
1014 rmills@rmills-linux:~/gnu/exiv2/test.build/test $ ./bugfixes-test.sh
52
426 440 443 444 445 447 452 460 479 480 495 498 501 528 540 554 662 666 683 711 726 751 769 799 800 831 (836 skipped) 841 876 
53
all testcases passed.</pre>
54
If all is good, it will produce a short output mostly saying 'all testcases passed.'.
55
56
If you encounter issues - large amounts of inexplicable output - you should run test/*.sh individually to identify which test (or tests) are failing, and read the code of the failing script.  Mosts tests use reference files in <exiv2dir>/test/data to create files in <exiv2dir>/test/tmp/ and files are output files are differences between the reference and the generated output.
57
58
Here are the results today (2013-01-18).  Of course the output of the test suite will change as exiv2 evolves. 
59
<pre>
60
1007 rmills@rmills-linux:~/gnu/exiv2/test.build $ make tests
61
cd test && make test
62
make[1]: Entering directory `/home/rmills/gnu/exiv2/test.build/test'
63
Running addmoddel.sh ...
64
all testcases passed.
65
Running bugfixes-test.sh ...
66
426 440 443 444 445 447 452 460 479 480 495 498 501 528 540 554 662 666 683 711 726 751 769 799 800 831 (836 skipped) 841 876 
67
all testcases passed.
68
Running exifdata-test.sh ...
69
all testcases passed.
70
Running exiv2-test.sh ...
71
all testcases passed.
72
Running imagetest.sh ...
73
74
Erase all tests..................
75
Copy all tests.........
76
Copy iptc tests.........
77
---------------------------------------------------------
78
All test cases passed
79
Running iotest.sh ...
80
81
Io tests...
82
---------------------------------------------------------
83
All test cases passed
84
Running iptctest.sh ...
85
86
Read tests..................
87
Remove tests..................
88
Add/Mod tests..................
89
Extended tests..................
90
---------------------------------------------------------
91
All test cases passed
92
Running modify-test.sh ...
93
all testcases passed.
94
Running path-test.sh ...
95
Running preview-test.sh ...
96
............................................................................................
97
All testcases passed.
98
Running stringto-test.sh ...
99
all testcases passed.
100
Running tiff-test.sh ...
101
tiff-test.sh: exifprobe not found. Skipping TIFF tests.
102
Running write-test.sh ...
103
all testcases passed.
104
Running write2-test.sh ...
105
all testcases passed.
106
Running xmpparser-test.sh ...
107
all testcases passed.
108
Running conversions.sh ...
109
all testcases passed.
110
make[1]: Leaving directory `/home/rmills/gnu/exiv2/test.build/test'
111
1008 rmills@rmills-linux:~/gnu/exiv2/test.build $ make teste
112
cd test && make teste
113
make[1]: Entering directory `/home/rmills/gnu/exiv2/test.build/test'
114
Running eps-test.sh ...
115
.............................................................................................................
116
All testcases passed.
117
make[1]: Leaving directory `/home/rmills/gnu/exiv2/test.build/test'
118
1009 rmills@rmills-linux:~/gnu/exiv2/test.build $ make testv
119
cd test && make testv
120
make[1]: Entering directory `/home/rmills/gnu/exiv2/test.build/test'
121
Running video-test.sh ...
122
.......
123
All testcases passed.
124
make[1]: Leaving directory `/home/rmills/gnu/exiv2/test.build/test'
125
1010 rmills@rmills-linux:~/gnu/exiv2/test.build $ 
126
</pre>