zint-barcode-generator/backend/tests
2020-09-30 12:19:12 +01:00
..
cmake/Modules New files 2019-09-01 21:09:47 +01:00
data vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00
tools vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00
CMakeLists.txt test_bmp/emf/print/ultra: update after pixel/colour changes, new test_ps 2020-08-12 22:16:11 +01:00
README UPC/EAN, ITF14: quiet zones, addongap; raster/vector: sync code, use double 2020-07-15 19:00:12 +01:00
test_2of5.c vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00
test_auspost.c vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00
test_aztec.c CODEONE/ULTRA overrun fixes; TELEPEN fixes; CODEONE/LOGMARS/VIN/CODABAR options; GUI updates; tests 2020-06-04 18:45:25 +01:00
test_bmp.c vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00
test_channel.c vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00
test_codablock.c vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00
test_code.c vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00
test_code1.c vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00
test_code16k.c vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00
test_code49.c vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00
test_code128.c vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00
test_common.c Test suite: add testRun allowing args; testSkip; haveIdentify/etc; general tidy-up 2020-05-05 22:28:25 +01:00
test_composite.c vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00
test_dmatrix.c DATAMATRIX: avoid unnecessary latch in X12 mode at end of data, #208 2020-09-28 19:46:23 +01:00
test_dotcode.c Test suite: add testRun allowing args; testSkip; haveIdentify/etc; general tidy-up 2020-05-05 22:28:25 +01:00
test_eci.c Change PDF417TRUNC -> PDF417COMP and version 2.8 -> 2.9 2020-07-29 22:35:31 +01:00
test_emf.c vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00
test_gb2312.c Test suite: add testRun allowing args; testSkip; haveIdentify/etc; general tidy-up 2020-05-05 22:28:25 +01:00
test_gb2312_tab.h HANXIN ECI conversion, GB 18030 LIBICONV port; some codeword fixes; optimized encoding modes 2019-12-08 16:15:34 +00:00
test_gb18030.c Test suite: add testRun allowing args; testSkip; haveIdentify/etc; general tidy-up 2020-05-05 22:28:25 +01:00
test_gb18030_tab.h HANXIN ECI conversion, GB 18030 LIBICONV port; some codeword fixes; optimized encoding modes 2019-12-08 16:15:34 +00:00
test_gif.c tif.c: allow strip_count 1 & specially handle; #191 clang-tidy warning 2020-05-06 19:57:27 +01:00
test_gridmtx.c CODEONE/ULTRA overrun fixes; TELEPEN fixes; CODEONE/LOGMARS/VIN/CODABAR options; GUI updates; tests 2020-06-04 18:45:25 +01:00
test_gs1.c vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00
test_hanxin.c CODEONE/ULTRA overrun fixes; TELEPEN fixes; CODEONE/LOGMARS/VIN/CODABAR options; GUI updates; tests 2020-06-04 18:45:25 +01:00
test_imail.c vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00
test_large.c large.c: replace binary_load/add() etc with uint64_t based large_load/add() etc for performance 2020-06-14 14:42:40 +01:00
test_library.c vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00
test_mailmark.c vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00
test_maxicode.c CODEONE/ULTRA overrun fixes; TELEPEN fixes; CODEONE/LOGMARS/VIN/CODABAR options; GUI updates; tests 2020-06-04 18:45:25 +01:00
test_medical.c vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00
test_pcx.c vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00
test_pdf417.c vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00
test_plessey.c CODEONE/ULTRA overrun fixes; TELEPEN fixes; CODEONE/LOGMARS/VIN/CODABAR options; GUI updates; tests 2020-06-04 18:45:25 +01:00
test_png.c vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00
test_postal.c vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00
test_print.c vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00
test_ps.c vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00
test_qr.c CODEONE/ULTRA overrun fixes; TELEPEN fixes; CODEONE/LOGMARS/VIN/CODABAR options; GUI updates; tests 2020-06-04 18:45:25 +01:00
test_raster.c vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00
test_rss.c vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00
test_sjis.c Test suite: add testRun allowing args; testSkip; haveIdentify/etc; general tidy-up 2020-05-05 22:28:25 +01:00
test_sjis_tab.h HANXIN ECI conversion, GB 18030 LIBICONV port; some codeword fixes; optimized encoding modes 2019-12-08 16:15:34 +00:00
test_svg.c vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00
test_telepen.c vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00
test_tif.c rss.c: some fixes for separators, allow check digit, refactoring; bwipp_dump.ps 2020-07-10 19:39:32 +01:00
test_ultra.c test_bmp/emf/print/ultra: update after pixel/colour changes, new test_ps 2020-08-12 22:16:11 +01:00
test_upcean.c vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00
test_vector.c vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00
testcommon.c vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00
testcommon.h vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00

Zint backend test suite
-----------------------

To make, first make libzint with ZINT_TEST defined:

  cd <project-dir>
  mkdir build
  cd build
  cmake -DZINT_TEST:BOOL=1 ..
  make

Then make the tests:

  cd <project-dir>
  cd backend/tests
  mkdir build
  cd build
  cmake -DZINT_TEST:BOOL=1 ..
  make

(ZINT_TEST is needed to export INTERNAL functions for use and testing.)

------------------------------------------------------------------------------

To run all tests (within <project-dir>/backend/tests/build):

  ctest

To run individual tests, eg:

  ./test_common
  ./test_vector

To run a single test function within an individual test, use '-f <func-name>':

  ./test_common -f utf8_to_unicode
  ./test_dotcode -f input

To run a single dataset item in a single test function, use '-i <index>':

  ./test_dotcode -f input -i 2

To show debug info (if any), use '-d <flag>':

  ./test_dotcode -f input -i 2 -d 1

(for other flags see <project-dir>/backend/tests/testcommon.h)

To generate test data, use '-g':

  ./test_dotcode -f encode -g

To run a test against BWIPP (if any), use '-d 128':

  ./test_composite -d 128

(see also <project-dir>/backend/tests/tools/run_bwipp_tests.sh)

------------------------------------------------------------------------------

To make with gcc sanitize, first set for libzint and make:

  cd <project-dir>
  cd build
  cmake -DZINT_SANITIZE:BOOL=1 ..
  make && sudo make install

Then set for tests and make:

  cd <project-dir>
  cd backend/tests/build
  cmake -DZINT_SANITIZE:BOOL=1 ..
  make

Similarly to make with gcc debug:

  cd <project-dir>
  cd build
  cmake -DZINT_DEBUG:BOOL=1 ..
  make && sudo make install

  cd <project-dir>
  cd backend/tests/build
  cmake -DZINT_DEBUG:BOOL=1 ..
  make

To undo sanitize/debug, remake each after setting:

  cmake -DZINT_SANITIZE:BOOL=0 ..
  cmake -DZINT_DEBUG:BOOL=0 ..

To get a clean libzint, set the above and also:

  cmake -DZINT_TEST:BOOL=0 ..

(The tests will now fail to link.)