zint/backend/tests
2021-02-08 02:45:11 +00:00
..
cmake/Modules Remove further refs to QZint; win32/README; add zintconfig.h to Win make files 2020-11-24 22:22:12 +00:00
data MAXICODE: scmvv option #212; postcode needn't be space-filled 2020-12-19 17:13:35 +00:00
tools gs1_verify: GMN (8013) update (gs1-format-spec.txt), X..25, csumalpha 2021-02-08 02:45:11 +00:00
CMakeLists.txt gs1_verify: validate AIs from BWIPP gs1-format-spec.txt 2021-01-18 20:10:52 +00: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 gs1_verify: 4308 no pcenc (gs1-format-spec.txt); GS1 General Spec 21.0.1 2021-01-28 23:41:54 +00:00
test_auspost.c AZTEC: fix bit-stuffing; AZTECRUNE: fix >= 128; DATAMATRIX: eod shift -> 0 pad; Qt6 2020-10-26 12:21:43 +00:00
test_aztec.c eci: Add support for all ECIs (Big5, Korean, UCS-2BE) 2021-01-11 18:11:41 +00:00
test_big5_tab.h eci: Add support for all ECIs (Big5, Korean, UCS-2BE) 2021-01-11 18:11:41 +00:00
test_big5.c eci: Add support for all ECIs (Big5, Korean, UCS-2BE) 2021-01-11 18:11:41 +00:00
test_bmp.c #209 suppress CodeQL warnings except CODEONE; simplifications AZTEC_RUNE, MICROPDF417 2020-12-23 10:57:24 +00:00
test_channel.c AZTEC: fix bit-stuffing; AZTECRUNE: fix >= 128; DATAMATRIX: eod shift -> 0 pad; Qt6 2020-10-26 12:21:43 +00:00
test_codablock.c AZTEC: fix bit-stuffing; AZTECRUNE: fix >= 128; DATAMATRIX: eod shift -> 0 pad; Qt6 2020-10-26 12:21:43 +00:00
test_code1.c CODEONE: various fixes, ECI support; #209 2021-02-05 23:55:24 +00:00
test_code16k.c AZTEC: fix bit-stuffing; AZTECRUNE: fix >= 128; DATAMATRIX: eod shift -> 0 pad; Qt6 2020-10-26 12:21:43 +00:00
test_code49.c AZTEC: fix bit-stuffing; AZTECRUNE: fix >= 128; DATAMATRIX: eod shift -> 0 pad; Qt6 2020-10-26 12:21:43 +00:00
test_code128.c gs1_verify: 4308 no pcenc (gs1-format-spec.txt); GS1 General Spec 21.0.1 2021-01-28 23:41:54 +00:00
test_code.c #209 suppress CodeQL warnings except CODEONE; simplifications AZTEC_RUNE, MICROPDF417 2020-12-23 10:57:24 +00:00
test_common.c HANXIN: 0xFFE terminator; reedsol/AZTEC: stack-based; AZTEC/HANXIN/QR/GRIDMATRIX speedups; #209 2020-11-27 12:54:44 +00:00
test_composite.c gs1_verify: 4308 no pcenc (gs1-format-spec.txt); GS1 General Spec 21.0.1 2021-01-28 23:41:54 +00:00
test_dmatrix.c gs1_verify: 4308 no pcenc (gs1-format-spec.txt); GS1 General Spec 21.0.1 2021-01-28 23:41:54 +00:00
test_dotcode.c DOTCODE: Fix best_mask -> high_score prime test; manual mask 2021-01-22 18:07:59 +00:00
test_eci.c CODEONE: various fixes, ECI support; #209 2021-02-05 23:55:24 +00:00
test_emf.c HANXIN: 0xFFE terminator; reedsol/AZTEC: stack-based; AZTEC/HANXIN/QR/GRIDMATRIX speedups; #209 2020-11-27 12:54:44 +00:00
test_gb2312_tab.h eci: Add support for all ECIs (Big5, Korean, UCS-2BE) 2021-01-11 18:11:41 +00:00
test_gb2312.c eci: Add support for all ECIs (Big5, Korean, UCS-2BE) 2021-01-11 18:11:41 +00:00
test_gb18030_tab.h eci: Add support for all ECIs (Big5, Korean, UCS-2BE) 2021-01-11 18:11:41 +00:00
test_gb18030.c eci: Add support for all ECIs (Big5, Korean, UCS-2BE) 2021-01-11 18:11:41 +00:00
test_gif.c #209 suppress CodeQL warnings except CODEONE; simplifications AZTEC_RUNE, MICROPDF417 2020-12-23 10:57:24 +00:00
test_gridmtx.c eci: Add support for all ECIs (Big5, Korean, UCS-2BE) 2021-01-11 18:11:41 +00:00
test_gs1.c gs1_verify: GMN (8013) update (gs1-format-spec.txt), X..25, csumalpha 2021-02-08 02:45:11 +00:00
test_hanxin.c eci: Add support for all ECIs (Big5, Korean, UCS-2BE) 2021-01-11 18:11:41 +00:00
test_imail.c AZTEC: fix bit-stuffing; AZTECRUNE: fix >= 128; DATAMATRIX: eod shift -> 0 pad; Qt6 2020-10-26 12:21:43 +00:00
test_iso3166.c gs1_verify: validate AIs from BWIPP gs1-format-spec.txt 2021-01-18 20:10:52 +00:00
test_iso4217.c gs1_verify: validate AIs from BWIPP gs1-format-spec.txt 2021-01-18 20:10:52 +00:00
test_ksx1001_tab.h eci: Add support for all ECIs (Big5, Korean, UCS-2BE) 2021-01-11 18:11:41 +00:00
test_ksx1001.c eci: Add support for all ECIs (Big5, Korean, UCS-2BE) 2021-01-11 18:11:41 +00:00
test_large.c Tabs/typo in zint.h; PostNet -> POSTNET; ui: shortcuts, tooltips; tests inkscape -> libreoffice 2020-10-03 22:51:08 +01:00
test_library.c CLI: Handle UTF-8 args on Windows; -b <barcode name> 2021-01-20 21:15:03 +00:00
test_mailmark.c EANX_CC: allow for check digit + buffer overflow for too long add-on; GUI text colour; cmake 3.0 2020-10-05 23:22:06 +01:00
test_maxicode.c MAXICODE: scmvv option #212; postcode needn't be space-filled 2020-12-19 17:13:35 +00:00
test_medical.c AZTEC: fix bit-stuffing; AZTECRUNE: fix >= 128; DATAMATRIX: eod shift -> 0 pad; Qt6 2020-10-26 12:21:43 +00:00
test_pcx.c Tabs/typo in zint.h; PostNet -> POSTNET; ui: shortcuts, tooltips; tests inkscape -> libreoffice 2020-10-03 22:51:08 +01:00
test_pdf417.c PDF417/raster: performance large data; common.h inline, module_colour_is_set(); #209 2020-11-01 18:32:55 +00:00
test_plessey.c #209 suppress CodeQL warnings except CODEONE; simplifications AZTEC_RUNE, MICROPDF417 2020-12-23 10:57:24 +00:00
test_png.c #209 suppress CodeQL warnings except CODEONE; simplifications AZTEC_RUNE, MICROPDF417 2020-12-23 10:57:24 +00:00
test_postal.c AZTEC: fix bit-stuffing; AZTECRUNE: fix >= 128; DATAMATRIX: eod shift -> 0 pad; Qt6 2020-10-26 12:21:43 +00:00
test_print.c MAXICODE: scmvv option #212; postcode needn't be space-filled 2020-12-19 17:13:35 +00:00
test_ps.c Tabs/typo in zint.h; PostNet -> POSTNET; ui: shortcuts, tooltips; tests inkscape -> libreoffice 2020-10-03 22:51:08 +01:00
test_qr.c gs1_verify: 4308 no pcenc (gs1-format-spec.txt); GS1 General Spec 21.0.1 2021-01-28 23:41:54 +00:00
test_raster.c CODEONE: various fixes, ECI support; #209 2021-02-05 23:55:24 +00:00
test_reedsol.c HANXIN: 0xFFE terminator; reedsol/AZTEC: stack-based; AZTEC/HANXIN/QR/GRIDMATRIX speedups; #209 2020-11-27 12:54:44 +00:00
test_rss.c gs1_verify: 4308 no pcenc (gs1-format-spec.txt); GS1 General Spec 21.0.1 2021-01-28 23:41:54 +00:00
test_sjis_tab.h eci: Add support for all ECIs (Big5, Korean, UCS-2BE) 2021-01-11 18:11:41 +00:00
test_sjis.c eci: Add support for all ECIs (Big5, Korean, UCS-2BE) 2021-01-11 18:11:41 +00:00
test_svg.c Tabs/typo in zint.h; PostNet -> POSTNET; ui: shortcuts, tooltips; tests inkscape -> libreoffice 2020-10-03 22:51:08 +01:00
test_telepen.c AZTEC: fix bit-stuffing; AZTECRUNE: fix >= 128; DATAMATRIX: eod shift -> 0 pad; Qt6 2020-10-26 12:21:43 +00:00
test_tif.c #209 suppress CodeQL warnings except CODEONE; simplifications AZTEC_RUNE, MICROPDF417 2020-12-23 10:57:24 +00:00
test_ultra.c GUI: tooltip tables too spaced; tests: Ultracode READER_INIT, more signedness fixes 2020-10-04 14:27:28 +01:00
test_upcean.c #209 rss.c, composite.c; DBAR_EXP encodation methods; symbol NO_PNG out.gif 2020-12-21 19:30:07 +00:00
test_vector.c CODEONE: various fixes, ECI support; #209 2021-02-05 23:55:24 +00:00
testcommon.c CODEONE: various fixes, ECI support; #209 2021-02-05 23:55:24 +00:00
testcommon.h #209 rss.c, composite.c; DBAR_EXP encodation methods; symbol NO_PNG out.gif 2020-12-21 19:30:07 +00: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.)