You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+46-28Lines changed: 46 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,8 +56,8 @@ The file ReadMe.txt in a build bundle describes how to install the library on th
56
56
4.[Test Suite](#4)
57
57
1.[Running tests on a UNIX-like system](#4-1)
58
58
2.[Running tests on Visual Studio builds](#4-2)
59
-
3.[Unit tests](#4-3)
60
-
4.[Bugfix tests](#4-4)
59
+
3.[Unit Tests](#4-3)
60
+
4.[Bugfix Tests](#4-4)
61
61
5.[Fuzzing](#4-5)
62
62
1.[OSS-Fuzz](#4-5-1)
63
63
5.[Platform Notes](#5)
@@ -853,39 +853,57 @@ For new bug reports, feature requests and support: Please open an issue in Gith
853
853
854
854
## 4 Test Suite
855
855
856
-
The test suite is implemented using CTest. CMake adds the target 'test' to the build. You can run ctest with the command`$ cmake --build . --target test`, or simply with `$ ctest`. The build creates 6 tests: bashTests, bugfixes, lensTest, tiffTests, unit_tests and versionTest. You can run all tests or a subset.
856
+
You execute the Test Suite using CTest with the command`$ ctest`.
857
+
858
+
The build creates 6 tests: bashTests, bugfixTests, lensTests, tiffTests, unitTests and versionTests. You can run all tests or a subset. To list all available tests, execute ctest with the `-N` or `--show-only` option, which disables execution:
859
+
860
+
```bash
861
+
.../main/build $ ctest -N
862
+
Test project ...main/build
863
+
Test #1: bashTests
864
+
Test #2: bugfixTests
865
+
Test #3: lensTests
866
+
Test #4: tiffTests
867
+
Test #5: versionTests
868
+
Test #6: unitTests
869
+
870
+
Total Tests: 6
871
+
.../main/build $
872
+
```
873
+
874
+
ctest provides many option and the following show common use-case scenarios:
857
875
858
876
```bash
859
-
$ cmake --build . --target test
860
877
$ ctest # run all tests and display summary
861
878
$ ctest --output-on-failure # run all tests and output failures
862
-
$ ctest -R bugfixes # run only bugfixes and display summary
863
-
$ ctest -R bugfixes --verbose # run only bugfixes and display all output
879
+
$ ctest -R bugfix# run only bugfixTests and display summary
880
+
$ ctest -R bugfix --verbose # run only bugfixTests and display all output
864
881
```
865
882
866
883
| Name | Language | Location | Command<br>_(in build directory)_ | CMake Option to Build |
|unit_tests| C++ | unitTests| $ ctest -R unit | -DEXIV2\_BUILD\_UNIT\_TESTS=On |
873
-
|versionTest | C++ | src/version.cpp | $ ctest -R version | Always in library |
889
+
|unitTests| C++ | unitTests/| $ ctest -R unit | -DEXIV2\_BUILD\_UNIT\_TESTS=On |
890
+
|versionTests| C++ | src/version.cpp | $ ctest -R version | Always in library |
874
891
875
-
The term _**bash**_ is historical. These tests were originally bash scripts and they have been rewritten in python. Visual Studio Users will appreciate the python implementation as it avoids the installation of mingw/cygwin and special PATH settings.
892
+
The term _**bashTests**_ is historical. These tests were originally bash scripts and have been rewritten in python.
893
+
Visual Studio Users will appreciate the python implementation as it avoids the installation of mingw/cygwin and special PATH settings.
876
894
877
895
#### Environment Variables used by the test suite:
878
896
879
897
If you build the code in the directory \<exiv2dir\>build, tests will run using the default values of Environment Variables.
880
898
881
-
| Variable | Default | Platforms | Purpose |
882
-
|:-- |:-- |:-- |:-- |
883
-
| EXIV2_BINDIR |**\<exiv2dir\>/build/bin**| All Platforms | Path of built binaries (exiv2.exe) |
884
-
| EXIV2_PORT |**12762**<br>**12671**<br>**12760**| Cygwin<br>MinGW/msys2<br>Other Platforms | Test TCP/IP Port |
899
+
| Variable | Default | Platforms | Purpose |
900
+
|:-- |:-- |:-- |:-- |
901
+
| EXIV2_BINDIR |**\<exiv2dir\>/build/bin**| All Platforms | Path of built binaries (exiv2.exe) |
902
+
| EXIV2_PORT |**12762**<br>**12671**<br>**12760**| Cygwin<br>MinGW/msys2<br>Other Platforms | Test TCP/IP Port |
885
903
| EXIV2_HTTP |**http://localhost**| All Platforms | Test http server |
886
-
| EXIV2_ECHO | _**not set**_ | All Platforms | For debugging bash scripts|
887
-
| VALGRIND | _**not set**_ | All Platforms | For debugging bash scripts|
888
-
| VERBOSE | _**not set**_ | Makefile platforms |Causes make to report its actions |
904
+
| EXIV2_ECHO | _**not set**_ | All Platforms | For debugging bashTests|
905
+
| VALGRIND | _**not set**_ | All Platforms | For debugging bashTests|
906
+
| VERBOSE | _**not set**_ | Makefile platforms |Instructs make to report its actions |
The Variable EXIV2\_PORT or EXIV2\_HTTP can be set to None to skip http tests. The http server is started with the command`python3 -m http.server $port`. On Windows, you will need to run this manually _**once**_ to authorise the firewall to permit python to use the port.
@@ -916,7 +934,7 @@ addmoddel_test (testcases.TestCases) ... ok
916
934
Ran 176 tests in 9.526s
917
935
OK (skipped=6)
918
936
919
-
$ ctest -R bugfixes --verbose
937
+
$ ctest -R bugfix --verbose
920
938
... lots of output ...
921
939
test_run (tiff_test.test_tiff_test_program.TestTiffTestProg) ... ok
You can execute the test suite in a similar manner to that described for UNIX-like systems. You _**must**_ provide the -C config option to ctest for Visual Studio builds.
957
+
You can execute the test suite in a similar manner to that described for UNIX-like systems. You _**must**_ provide the `-C` config option to ctest for Visual Studio builds.
940
958
941
959
```cmd
942
960
>cd<exiv2dir>/build
943
961
> ctest -C Release
944
-
> ctest -C Release -R bugfixes --verbose
962
+
> ctest -C Release -R bugfix --verbose
945
963
```
946
964
Visual Studio can build different configs as follows:
947
965
@@ -977,7 +995,7 @@ set EXIV2_PORT=
977
995
978
996
[TOC](#TOC)
979
997
<div id="4-3">
980
-
### 4.3 Unit tests
998
+
### 4.3 Unit Tests
981
999
982
1000
The code forthe unit tests isin`<exiv2dir>/unitTests`. To include unit tests in the build, use the *cmake* option `-DEXIV2_BUILD_UNIT_TESTS=On`.
983
1001
@@ -996,23 +1014,23 @@ $ popd
996
1014
997
1015
[TOC](#TOC)
998
1016
<div id="4-4">
999
-
### 4.4 Bugfix tests
1017
+
### 4.4 Bugfix Tests
1000
1018
1001
1019
You can run the bugfix tests from the build directory:
1002
1020
1003
1021
```bash
1004
1022
$ cd<exiv2dir>/build
1005
-
$ ctest -R bugfixes
1023
+
$ ctest -R bugfix
1006
1024
```
1007
1025
1008
1026
If you wish to run in verbose mode:
1009
1027
1010
1028
```bash
1011
1029
$ cd<exiv2dir>/build
1012
-
$ $ ctest -R bugfixes --verbose
1030
+
$ $ ctest -R bugfix --verbose
1013
1031
```
1014
1032
1015
-
The bugfix tests are stored inthe directory tests and you can run them all with the command:
1033
+
The bugfix tests are stored in directory tests/ and you can run them all with the command:
1016
1034
1017
1035
```bash
1018
1036
$ cd<exiv2dir>/tests
@@ -1031,7 +1049,7 @@ You may wish to get a brief summary of failures with commands such as:
0 commit comments