2019-11-28 05:16:14 +13:00
|
|
|
Zint backend test suite
|
|
|
|
-----------------------
|
|
|
|
|
2021-06-10 22:15:39 +12:00
|
|
|
In order to build the zint test suite, zint has to be compiled with the
|
2021-03-23 02:56:57 +13:00
|
|
|
ZINT_TEST option enabled:
|
2019-12-19 13:37:55 +13:00
|
|
|
|
|
|
|
cd <project-dir>
|
|
|
|
mkdir build
|
|
|
|
cd build
|
2021-03-17 12:38:47 +13:00
|
|
|
cmake -DZINT_TEST=ON ..
|
2021-11-24 01:10:58 +13:00
|
|
|
cmake --build .
|
2019-12-19 13:37:55 +13:00
|
|
|
|
2021-11-24 01:10:58 +13:00
|
|
|
When using generators that support multiple build configurations, such as
|
|
|
|
Visual C++ Project Files (the default generator on win32), the configuration
|
|
|
|
can be provided via --config:
|
|
|
|
|
|
|
|
cd <project-dir>
|
|
|
|
mkdir build
|
|
|
|
cd build
|
2023-01-09 14:14:42 +13:00
|
|
|
cmake -DZINT_TEST=ON -DCMAKE_BUILD_TYPE=Debug ..
|
2021-11-24 01:10:58 +13:00
|
|
|
cmake --build . --config Debug
|
2023-01-09 14:14:42 +13:00
|
|
|
|
|
|
|
Note specifying a matching CMAKE_BUILD_TYPE is required to set the test PATH
|
|
|
|
environment for Windows.
|
2021-11-24 01:10:58 +13:00
|
|
|
|
2021-03-23 02:56:57 +13:00
|
|
|
------------------------------------------------------------------------------
|
|
|
|
|
2021-06-10 22:15:39 +12:00
|
|
|
In order to run the test suite, the path of the zint library may need to be
|
|
|
|
communicated to the runtime linker. On UNIX-like systems, this is done by
|
|
|
|
exporting LD_LIBRARY_PATH to the path containing the zint library, which is
|
|
|
|
<build-dir>/backend:
|
2019-11-28 05:16:14 +13:00
|
|
|
|
|
|
|
cd <project-dir>
|
|
|
|
cd build
|
2021-03-23 02:56:57 +13:00
|
|
|
export LD_LIBRARY_PATH=$(pwd)/backend
|
2021-06-10 22:15:39 +12:00
|
|
|
|
2021-03-23 02:56:57 +13:00
|
|
|
Setting LD_LIBRARY_PATH is not required if the zint library to be tested is
|
|
|
|
installed into a system library path ( /usr/lib for example ) prior to running
|
2023-01-09 14:14:42 +13:00
|
|
|
the tests, or if the tests are not run individually.
|
|
|
|
|
|
|
|
(On Windows, the PATH may need to be set to include the DLL location.)
|
|
|
|
|
|
|
|
------------------------------------------------------------------------------
|
2021-06-10 22:15:39 +12:00
|
|
|
|
|
|
|
To run all tests (within <build-dir>):
|
2020-05-06 09:28:25 +12:00
|
|
|
|
|
|
|
ctest
|
2019-11-28 05:16:14 +13:00
|
|
|
|
2021-11-24 01:10:58 +13:00
|
|
|
When using a generator that does support multiple build configurations, the
|
|
|
|
configuration that was used to build the project has to be explicitly provided
|
|
|
|
to ctest, even if it was the default one:
|
|
|
|
|
|
|
|
ctest -C Debug
|
|
|
|
|
2021-06-10 22:15:39 +12:00
|
|
|
For various useful options, e.g. matching (-R) and excluding (-E) tests, see
|
|
|
|
https://cmake.org/cmake/help/latest/manual/ctest.1.html#options
|
|
|
|
|
|
|
|
Tests can also be run individually, eg:
|
2019-11-28 05:16:14 +13:00
|
|
|
|
2021-06-10 22:15:39 +12:00
|
|
|
backend/tests/test_common
|
|
|
|
backend/tests/test_vector
|
2019-11-28 05:16:14 +13:00
|
|
|
|
2020-05-06 09:28:25 +12:00
|
|
|
To run a single test function within an individual test, use '-f <func-name>':
|
|
|
|
|
2021-06-10 22:15:39 +12:00
|
|
|
backend/tests/test_common -f utf8_to_unicode
|
|
|
|
backend/tests/test_dotcode -f input
|
2020-05-06 09:28:25 +12:00
|
|
|
|
|
|
|
To run a single dataset item in a single test function, use '-i <index>':
|
|
|
|
|
2021-06-10 22:15:39 +12:00
|
|
|
backend/tests/test_dotcode -f input -i 2
|
2020-05-06 09:28:25 +12:00
|
|
|
|
- API: add new zint_symbol `dpmm` field for output resolution (BMP/
EMF/PCX/PNG/TIF only, i.e. excluding EPS, GIF & SVG)
- Add support for specifying scale by X-dimension and resolution
with new option `--scalexdimdp` for CLI/Tcl & new API function
`ZBarcode_Scale_From_XdimDp()` (+ `ZBarcode_XdimDp_From_Scale()`
& `ZBarcode_Default_Xdim()`) and new GUI popup; manual: document
- BMP/EMF/PCX/PNG/TIF: use new `dpmm` resolution field (for EMF
following Inkscape)
- backend_qt: add `dpmm()`, `vectorWidth()`, `vectorHeight()`,
`noPng()`, `getVersion()`, `takesGS1AIData()`, & `XdimDp` stuff
incl. new `QZintXdimDp` struct for passing around scale vars &
use in `getAsCLI()`; add comments
- Raise `scale` limit to 200 (from 100) to allow for large dpmm
- output: create directories & subdirectories as necessary for
output path using new function `out_fopen()` and use in BMP/EMF/
EPS/GIF/PCX/PNG/SVG/TIF
- DPLEIT/DPIDENT: format HRT according to (incomplete)
documentation, and set default height to 72X (from 50X)
- CODE128B renamed to CODE128AB as can use subsets A and/or B
- CODABAR: fix minimum height calc
- EMF: fix indexing of handles (zero-based not 1-based)
- GUI: fix symbology zap (previous technique of clearing and
re-loading settings without doing a sync no longer works);
fix UPCEAN guard descent enable
- MAILMARK: better error message if input < 14 characters
- GUI: add "Default" button for DAFT tracker ratio & enable/disable
various default buttons; use new `takesGS1AIData()` to
enable/disable GS1-specific checkboxes
- CLI: use new `validate_float()` to parse float options (7
significant digits allowed only, no scientific notation)
- DATAMATRIX/GRIDMATRIX/PDF417/QR/ULTRA: micro-optimize structapp
ID parse
- library/CLI: fiddle with static asserts (make CHAR_BIT sensitive,
supposedly)
- win32/README: update building libpng (assembly removed)
- README.linux: document incompatibility of Qt6 >= 6.3
- manual: expand Barcode Studio waffle
- test suite: change range separator to hyphen and allow multiple
excludes
2022-12-03 10:39:01 +13:00
|
|
|
To run a range of dataset items in a single test function, use '-i <start>-<end>':
|
2022-09-13 06:26:04 +12:00
|
|
|
|
- API: add new zint_symbol `dpmm` field for output resolution (BMP/
EMF/PCX/PNG/TIF only, i.e. excluding EPS, GIF & SVG)
- Add support for specifying scale by X-dimension and resolution
with new option `--scalexdimdp` for CLI/Tcl & new API function
`ZBarcode_Scale_From_XdimDp()` (+ `ZBarcode_XdimDp_From_Scale()`
& `ZBarcode_Default_Xdim()`) and new GUI popup; manual: document
- BMP/EMF/PCX/PNG/TIF: use new `dpmm` resolution field (for EMF
following Inkscape)
- backend_qt: add `dpmm()`, `vectorWidth()`, `vectorHeight()`,
`noPng()`, `getVersion()`, `takesGS1AIData()`, & `XdimDp` stuff
incl. new `QZintXdimDp` struct for passing around scale vars &
use in `getAsCLI()`; add comments
- Raise `scale` limit to 200 (from 100) to allow for large dpmm
- output: create directories & subdirectories as necessary for
output path using new function `out_fopen()` and use in BMP/EMF/
EPS/GIF/PCX/PNG/SVG/TIF
- DPLEIT/DPIDENT: format HRT according to (incomplete)
documentation, and set default height to 72X (from 50X)
- CODE128B renamed to CODE128AB as can use subsets A and/or B
- CODABAR: fix minimum height calc
- EMF: fix indexing of handles (zero-based not 1-based)
- GUI: fix symbology zap (previous technique of clearing and
re-loading settings without doing a sync no longer works);
fix UPCEAN guard descent enable
- MAILMARK: better error message if input < 14 characters
- GUI: add "Default" button for DAFT tracker ratio & enable/disable
various default buttons; use new `takesGS1AIData()` to
enable/disable GS1-specific checkboxes
- CLI: use new `validate_float()` to parse float options (7
significant digits allowed only, no scientific notation)
- DATAMATRIX/GRIDMATRIX/PDF417/QR/ULTRA: micro-optimize structapp
ID parse
- library/CLI: fiddle with static asserts (make CHAR_BIT sensitive,
supposedly)
- win32/README: update building libpng (assembly removed)
- README.linux: document incompatibility of Qt6 >= 6.3
- manual: expand Barcode Studio waffle
- test suite: change range separator to hyphen and allow multiple
excludes
2022-12-03 10:39:01 +13:00
|
|
|
backend/tests/test_dotcode -f input -i 2-5
|
2022-09-13 06:26:04 +12:00
|
|
|
|
|
|
|
To exclude a single dataset item in a single test function, use '-x <index>':
|
|
|
|
|
|
|
|
backend/tests/test_dotcode -f input -x 4
|
|
|
|
|
- API: add new zint_symbol `dpmm` field for output resolution (BMP/
EMF/PCX/PNG/TIF only, i.e. excluding EPS, GIF & SVG)
- Add support for specifying scale by X-dimension and resolution
with new option `--scalexdimdp` for CLI/Tcl & new API function
`ZBarcode_Scale_From_XdimDp()` (+ `ZBarcode_XdimDp_From_Scale()`
& `ZBarcode_Default_Xdim()`) and new GUI popup; manual: document
- BMP/EMF/PCX/PNG/TIF: use new `dpmm` resolution field (for EMF
following Inkscape)
- backend_qt: add `dpmm()`, `vectorWidth()`, `vectorHeight()`,
`noPng()`, `getVersion()`, `takesGS1AIData()`, & `XdimDp` stuff
incl. new `QZintXdimDp` struct for passing around scale vars &
use in `getAsCLI()`; add comments
- Raise `scale` limit to 200 (from 100) to allow for large dpmm
- output: create directories & subdirectories as necessary for
output path using new function `out_fopen()` and use in BMP/EMF/
EPS/GIF/PCX/PNG/SVG/TIF
- DPLEIT/DPIDENT: format HRT according to (incomplete)
documentation, and set default height to 72X (from 50X)
- CODE128B renamed to CODE128AB as can use subsets A and/or B
- CODABAR: fix minimum height calc
- EMF: fix indexing of handles (zero-based not 1-based)
- GUI: fix symbology zap (previous technique of clearing and
re-loading settings without doing a sync no longer works);
fix UPCEAN guard descent enable
- MAILMARK: better error message if input < 14 characters
- GUI: add "Default" button for DAFT tracker ratio & enable/disable
various default buttons; use new `takesGS1AIData()` to
enable/disable GS1-specific checkboxes
- CLI: use new `validate_float()` to parse float options (7
significant digits allowed only, no scientific notation)
- DATAMATRIX/GRIDMATRIX/PDF417/QR/ULTRA: micro-optimize structapp
ID parse
- library/CLI: fiddle with static asserts (make CHAR_BIT sensitive,
supposedly)
- win32/README: update building libpng (assembly removed)
- README.linux: document incompatibility of Qt6 >= 6.3
- manual: expand Barcode Studio waffle
- test suite: change range separator to hyphen and allow multiple
excludes
2022-12-03 10:39:01 +13:00
|
|
|
This can also take a range, '-x <start>-<end>':
|
2022-09-13 06:26:04 +12:00
|
|
|
|
2023-01-09 14:14:42 +13:00
|
|
|
backend/tests/test_dotcode -f input -x 4-6
|
2022-09-13 06:26:04 +12:00
|
|
|
|
- API: add new zint_symbol `dpmm` field for output resolution (BMP/
EMF/PCX/PNG/TIF only, i.e. excluding EPS, GIF & SVG)
- Add support for specifying scale by X-dimension and resolution
with new option `--scalexdimdp` for CLI/Tcl & new API function
`ZBarcode_Scale_From_XdimDp()` (+ `ZBarcode_XdimDp_From_Scale()`
& `ZBarcode_Default_Xdim()`) and new GUI popup; manual: document
- BMP/EMF/PCX/PNG/TIF: use new `dpmm` resolution field (for EMF
following Inkscape)
- backend_qt: add `dpmm()`, `vectorWidth()`, `vectorHeight()`,
`noPng()`, `getVersion()`, `takesGS1AIData()`, & `XdimDp` stuff
incl. new `QZintXdimDp` struct for passing around scale vars &
use in `getAsCLI()`; add comments
- Raise `scale` limit to 200 (from 100) to allow for large dpmm
- output: create directories & subdirectories as necessary for
output path using new function `out_fopen()` and use in BMP/EMF/
EPS/GIF/PCX/PNG/SVG/TIF
- DPLEIT/DPIDENT: format HRT according to (incomplete)
documentation, and set default height to 72X (from 50X)
- CODE128B renamed to CODE128AB as can use subsets A and/or B
- CODABAR: fix minimum height calc
- EMF: fix indexing of handles (zero-based not 1-based)
- GUI: fix symbology zap (previous technique of clearing and
re-loading settings without doing a sync no longer works);
fix UPCEAN guard descent enable
- MAILMARK: better error message if input < 14 characters
- GUI: add "Default" button for DAFT tracker ratio & enable/disable
various default buttons; use new `takesGS1AIData()` to
enable/disable GS1-specific checkboxes
- CLI: use new `validate_float()` to parse float options (7
significant digits allowed only, no scientific notation)
- DATAMATRIX/GRIDMATRIX/PDF417/QR/ULTRA: micro-optimize structapp
ID parse
- library/CLI: fiddle with static asserts (make CHAR_BIT sensitive,
supposedly)
- win32/README: update building libpng (assembly removed)
- README.linux: document incompatibility of Qt6 >= 6.3
- manual: expand Barcode Studio waffle
- test suite: change range separator to hyphen and allow multiple
excludes
2022-12-03 10:39:01 +13:00
|
|
|
Exclude can be used multiple times (unlike '-i'):
|
|
|
|
|
|
|
|
backend/tests/test_dotcode -f input -x 4 -x 6-8
|
|
|
|
|
2022-09-13 06:26:04 +12:00
|
|
|
The include and exclude options can be used together:
|
|
|
|
|
- API: add new zint_symbol `dpmm` field for output resolution (BMP/
EMF/PCX/PNG/TIF only, i.e. excluding EPS, GIF & SVG)
- Add support for specifying scale by X-dimension and resolution
with new option `--scalexdimdp` for CLI/Tcl & new API function
`ZBarcode_Scale_From_XdimDp()` (+ `ZBarcode_XdimDp_From_Scale()`
& `ZBarcode_Default_Xdim()`) and new GUI popup; manual: document
- BMP/EMF/PCX/PNG/TIF: use new `dpmm` resolution field (for EMF
following Inkscape)
- backend_qt: add `dpmm()`, `vectorWidth()`, `vectorHeight()`,
`noPng()`, `getVersion()`, `takesGS1AIData()`, & `XdimDp` stuff
incl. new `QZintXdimDp` struct for passing around scale vars &
use in `getAsCLI()`; add comments
- Raise `scale` limit to 200 (from 100) to allow for large dpmm
- output: create directories & subdirectories as necessary for
output path using new function `out_fopen()` and use in BMP/EMF/
EPS/GIF/PCX/PNG/SVG/TIF
- DPLEIT/DPIDENT: format HRT according to (incomplete)
documentation, and set default height to 72X (from 50X)
- CODE128B renamed to CODE128AB as can use subsets A and/or B
- CODABAR: fix minimum height calc
- EMF: fix indexing of handles (zero-based not 1-based)
- GUI: fix symbology zap (previous technique of clearing and
re-loading settings without doing a sync no longer works);
fix UPCEAN guard descent enable
- MAILMARK: better error message if input < 14 characters
- GUI: add "Default" button for DAFT tracker ratio & enable/disable
various default buttons; use new `takesGS1AIData()` to
enable/disable GS1-specific checkboxes
- CLI: use new `validate_float()` to parse float options (7
significant digits allowed only, no scientific notation)
- DATAMATRIX/GRIDMATRIX/PDF417/QR/ULTRA: micro-optimize structapp
ID parse
- library/CLI: fiddle with static asserts (make CHAR_BIT sensitive,
supposedly)
- win32/README: update building libpng (assembly removed)
- README.linux: document incompatibility of Qt6 >= 6.3
- manual: expand Barcode Studio waffle
- test suite: change range separator to hyphen and allow multiple
excludes
2022-12-03 10:39:01 +13:00
|
|
|
backend/tests/test_dotcode -f input -i 2-7 -x 4 -x 6
|
2022-09-13 06:26:04 +12:00
|
|
|
|
2020-05-06 09:28:25 +12:00
|
|
|
To show debug info (if any), use '-d <flag>':
|
|
|
|
|
2021-06-10 22:15:39 +12:00
|
|
|
backend/tests/test_dotcode -f input -i 2 -d 1
|
2020-05-06 09:28:25 +12:00
|
|
|
|
2022-09-13 06:26:04 +12:00
|
|
|
E.g. to print which dataset items are being run, use '-d 16':
|
2020-07-16 06:00:12 +12:00
|
|
|
|
2022-09-13 06:26:04 +12:00
|
|
|
backend/tests/test_dotcode -f input -d 16 -i 2
|
2020-05-06 09:28:25 +12:00
|
|
|
|
2022-09-13 06:26:04 +12:00
|
|
|
(for other flags see <project-dir>/backend/tests/testcommon.h)
|
2020-05-06 09:28:25 +12:00
|
|
|
|
2020-07-16 06:00:12 +12:00
|
|
|
To run a test against BWIPP (if any), use '-d 128':
|
|
|
|
|
2021-06-10 22:15:39 +12:00
|
|
|
backend/tests/test_composite -d 128
|
2020-07-16 06:00:12 +12:00
|
|
|
|
|
|
|
(see also <project-dir>/backend/tests/tools/run_bwipp_tests.sh)
|
|
|
|
|
2022-09-13 06:26:04 +12:00
|
|
|
To run a test against ZXing-C++ (if any), use '-d 512':
|
|
|
|
|
|
|
|
backend/tests/test_rss -d 512
|
|
|
|
|
|
|
|
(see also <project-dir>/backend/tests/tools/run_zxingcpp_tests.sh)
|
|
|
|
|
|
|
|
To generate test data, use '-g':
|
|
|
|
|
|
|
|
backend/tests/test_dotcode -f encode -g
|
|
|
|
|
2020-05-06 09:28:25 +12:00
|
|
|
------------------------------------------------------------------------------
|
|
|
|
|
2021-03-23 02:56:57 +13:00
|
|
|
If the zint library was built with static linkage support, i.e. ZINT_STATIC
|
|
|
|
is ON, an additional test executable, which uses the zint-static library, will
|
|
|
|
be built. The static variant of each test shares the test name, but has a
|
2021-06-10 22:15:39 +12:00
|
|
|
"-static" suffix. For example,
|
2021-03-23 02:56:57 +13:00
|
|
|
|
2021-06-10 22:15:39 +12:00
|
|
|
backend/tests/test_dotcode
|
2021-03-23 02:56:57 +13:00
|
|
|
|
|
|
|
would run the dotcode test that uses the shared zint library, while
|
|
|
|
|
2021-06-10 22:15:39 +12:00
|
|
|
backend/tests/test_dotcode-static
|
2021-03-23 02:56:57 +13:00
|
|
|
|
|
|
|
runs the same test built against the zint-static library.
|
|
|
|
|
|
|
|
------------------------------------------------------------------------------
|
|
|
|
|
2019-11-28 05:16:14 +13:00
|
|
|
To make with gcc sanitize, first set for libzint and make:
|
|
|
|
|
|
|
|
cd <project-dir>
|
|
|
|
cd build
|
2021-03-17 12:38:47 +13:00
|
|
|
cmake -DZINT_SANITIZE=ON ..
|
2019-11-28 05:16:14 +13:00
|
|
|
make && sudo make install
|
|
|
|
|
|
|
|
Similarly to make with gcc debug:
|
|
|
|
|
|
|
|
cd <project-dir>
|
|
|
|
cd build
|
2021-03-17 12:38:47 +13:00
|
|
|
cmake -DZINT_DEBUG=ON ..
|
2019-11-28 05:16:14 +13:00
|
|
|
make && sudo make install
|
|
|
|
|
|
|
|
To undo sanitize/debug, remake each after setting:
|
|
|
|
|
2021-03-17 12:38:47 +13:00
|
|
|
cmake -DZINT_SANITIZE=OFF ..
|
|
|
|
cmake -DZINT_DEBUG=OFF ..
|
2019-11-28 05:16:14 +13:00
|
|
|
|
2019-12-19 13:37:55 +13:00
|
|
|
To get a clean libzint, set the above and also:
|
|
|
|
|
2021-03-17 12:38:47 +13:00
|
|
|
cmake -DZINT_TEST=OFF ..
|
2019-12-19 13:37:55 +13:00
|
|
|
|
|
|
|
(The tests will now fail to link.)
|
2021-03-23 02:56:57 +13:00
|
|
|
|