Skip to content

Commit

Permalink
Merge pull request #283 from openzim/version_3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mgautierfr authored Jan 19, 2022
2 parents 3a9a989 + 4904a96 commit 09fad0d
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 28 deletions.
19 changes: 16 additions & 3 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
zim-tools 3.1.0
===============

* zimcheck: Fix json output (Use `"` instead of `'`) for strings
(@mgautierfr #281)
* zimcheck: Avoid undefined behavior (and crash) when testing link's content.
(@mgautierfr #280)
* The `--version` option now also print the version of all dependencies (@kelson42, #275)
* zimcheck: Add the zimcheck version in the output log (@kelson42, #274)
* CI: Readd build on Ubuntu Impish (@kelson42, #267)
* CI: Add build on Ubuntu Jammy (@legoktm, #273)


zim-tools 3.0.0
===============

Expand All @@ -12,7 +25,7 @@ zim-tools 3.0.0
use (@data-man #235)
* remove zstd compression options. We are now always creating zim file with
zstd (@kelson42 #261, 264)
* zimwriterfs: Do not use the extension of file as mimetype (@mgautier #265)
* zimwriterfs: Do not use the extension of file as mimetype (@mgautierfr #265)
* zimcheck: Improve performance of detection of the kind of url
(@veloman-yunkan #179)
* Support new protocols xmpp, news and urn (@kelson42 #205)
Expand All @@ -24,9 +37,9 @@ zim-tools 3.0.0
* zimdump: Fix argument --ns not working (@maneesh #216)
* Add zimcheck unit tests (@veloman-yunkan #215)
* zimdump: Fix http redirect (@veloman-yunkan #225)
* Adapt zim tools to new libzim api (@mgautier @veloman-yunkan @maneesh)
* Adapt zim tools to new libzim api (@mgautierfr @veloman-yunkan @maneesh)
* Compile zimsearch binary only if libzim is compiled with xapian
(@mgautier, #201)
(@mgautierfr, #201)
* Docker : Better open zimtools image (@rgaudin #209)

zim-tools 2.1.0
Expand Down
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Maintainer: Kiwix team <[email protected]>
Build-Depends: debhelper-compat (= 13),
meson,
pkg-config,
libzim-dev (>= 6.3.0),
libzim-dev (>= 7.2.0),
libmagic-dev,
zlib1g-dev,
libgumbo-dev,
Expand Down
4 changes: 2 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
project('zim-tools', ['c', 'cpp'],
version : '3.0.0', # Also change zimcheck_version in tests
version : '3.1.0',
license : 'GPLv3+',
default_options : ['c_std=c11', 'cpp_std=c++11', 'werror=true'])

Expand All @@ -16,7 +16,7 @@ if static_linkage
endif
endif

libzim_dep = dependency('libzim', version : '>=7.0.0', static:static_linkage)
libzim_dep = dependency('libzim', version : '>=7.2.0', static:static_linkage)
with_xapian_support = compiler.has_header_symbol('zim/zim.h', 'LIBZIM_WITH_XAPIAN')

find_library_in_compiler = meson.version().version_compare('>=0.31.0')
Expand Down
44 changes: 22 additions & 22 deletions test/zimcheck-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ TEST(zimcheck, integrity_goodzimfile)
{
const std::string expected_output(
"[INFO] Checking zim file data/zimfiles/good.zim" "\n"
"[INFO] Zimcheck version is 3.0.0" "\n"
"[INFO] Zimcheck version is " VERSION "\n"
"[INFO] Verifying ZIM-archive structure integrity..." "\n"
"[INFO] Overall Test Status: Pass" "\n"
"[INFO] Total time taken by zimcheck: 0 seconds." "\n"
Expand All @@ -273,7 +273,7 @@ TEST(zimcheck, checksum_goodzimfile)
{
const std::string expected_output(
"[INFO] Checking zim file data/zimfiles/good.zim" "\n"
"[INFO] Zimcheck version is 3.0.0" "\n"
"[INFO] Zimcheck version is " VERSION "\n"
"[INFO] Verifying Internal Checksum..." "\n"
"[INFO] Overall Test Status: Pass" "\n"
"[INFO] Total time taken by zimcheck: 0 seconds." "\n"
Expand All @@ -292,7 +292,7 @@ TEST(zimcheck, metadata_goodzimfile)
{
const std::string expected_output(
"[INFO] Checking zim file data/zimfiles/good.zim" "\n"
"[INFO] Zimcheck version is 3.0.0" "\n"
"[INFO] Zimcheck version is " VERSION "\n"
"[INFO] Searching for metadata entries..." "\n"
"[INFO] Overall Test Status: Pass" "\n"
"[INFO] Total time taken by zimcheck: 0 seconds." "\n"
Expand All @@ -311,7 +311,7 @@ TEST(zimcheck, favicon_goodzimfile)
{
const std::string expected_output(
"[INFO] Checking zim file data/zimfiles/good.zim" "\n"
"[INFO] Zimcheck version is 3.0.0" "\n"
"[INFO] Zimcheck version is " VERSION "\n"
"[INFO] Searching for Favicon..." "\n"
"[INFO] Overall Test Status: Pass" "\n"
"[INFO] Total time taken by zimcheck: 0 seconds." "\n"
Expand All @@ -330,7 +330,7 @@ TEST(zimcheck, mainpage_goodzimfile)
{
const std::string expected_output(
"[INFO] Checking zim file data/zimfiles/good.zim" "\n"
"[INFO] Zimcheck version is 3.0.0" "\n"
"[INFO] Zimcheck version is " VERSION "\n"
"[INFO] Searching for main page..." "\n"
"[INFO] Overall Test Status: Pass" "\n"
"[INFO] Total time taken by zimcheck: 0 seconds." "\n"
Expand All @@ -349,7 +349,7 @@ TEST(zimcheck, article_content_goodzimfile)
{
const std::string expected_output(
"[INFO] Checking zim file data/zimfiles/good.zim" "\n"
"[INFO] Zimcheck version is 3.0.0" "\n"
"[INFO] Zimcheck version is " VERSION "\n"
"[INFO] Verifying Articles' content..." "\n"
"[INFO] Overall Test Status: Pass" "\n"
"[INFO] Total time taken by zimcheck: 0 seconds." "\n"
Expand All @@ -372,7 +372,7 @@ TEST(zimcheck, redundant_articles_goodzimfile)
{
const std::string expected_output(
"[INFO] Checking zim file data/zimfiles/good.zim" "\n"
"[INFO] Zimcheck version is 3.0.0" "\n"
"[INFO] Zimcheck version is " VERSION "\n"
"[INFO] Verifying Articles' content..." "\n"
"[INFO] Searching for redundant articles..." "\n"
" Verifying Similar Articles for redundancies..." "\n"
Expand All @@ -393,7 +393,7 @@ TEST(zimcheck, redirect_loop_goodzimfile)
{
const std::string expected_output(
"[INFO] Checking zim file data/zimfiles/good.zim" "\n"
"[INFO] Zimcheck version is 3.0.0" "\n"
"[INFO] Zimcheck version is " VERSION "\n"
"[INFO] Checking for redirect loops..." "\n"
"[INFO] Overall Test Status: Pass" "\n"
"[INFO] Total time taken by zimcheck: 0 seconds." "\n"
Expand All @@ -410,7 +410,7 @@ TEST(zimcheck, redirect_loop_goodzimfile)

const std::string ALL_CHECKS_OUTPUT_ON_GOODZIMFILE(
"[INFO] Checking zim file data/zimfiles/good.zim" "\n"
"[INFO] Zimcheck version is 3.0.0" "\n"
"[INFO] Zimcheck version is " VERSION "\n"
"[INFO] Verifying ZIM-archive structure integrity..." "\n"
"[INFO] Avoiding redundant checksum test (already performed by the integrity check)." "\n"
"[INFO] Searching for metadata entries..." "\n"
Expand Down Expand Up @@ -476,7 +476,7 @@ TEST(zimcheck, json_goodzimfile)

ASSERT_EQ(
"{" "\n"
" \"zimcheck_version\" : \"3.0.0\"," "\n"
" \"zimcheck_version\" : \"" VERSION "\"," "\n"
" \"checks\" : [" "\n"
" \"checksum\"," "\n"
" \"integrity\"," "\n"
Expand All @@ -503,7 +503,7 @@ TEST(zimcheck, bad_checksum)
{
const std::string expected_output(
"[INFO] Checking zim file data/zimfiles/bad_checksum.zim" "\n"
"[INFO] Zimcheck version is 3.0.0" "\n"
"[INFO] Zimcheck version is " VERSION "\n"
"[INFO] Verifying Internal Checksum..." "\n"
" [ERROR] Wrong Checksum in ZIM archive" "\n"
"[ERROR] Invalid checksum:" "\n"
Expand All @@ -526,7 +526,7 @@ TEST(zimcheck, metadata_poorzimfile)
{
const std::string expected_stdout(
"[INFO] Checking zim file data/zimfiles/poor.zim" "\n"
"[INFO] Zimcheck version is 3.0.0" "\n"
"[INFO] Zimcheck version is " VERSION "\n"
"[INFO] Searching for metadata entries..." "\n"
"[ERROR] Missing metadata entries:" "\n"
" Title" "\n"
Expand All @@ -548,7 +548,7 @@ TEST(zimcheck, favicon_poorzimfile)
{
const std::string expected_stdout(
"[INFO] Checking zim file data/zimfiles/poor.zim" "\n"
"[INFO] Zimcheck version is 3.0.0" "\n"
"[INFO] Zimcheck version is " VERSION "\n"
"[INFO] Searching for Favicon..." "\n"
"[ERROR] Favicon:" "\n"
" Favicon is missing" "\n"
Expand All @@ -569,7 +569,7 @@ TEST(zimcheck, mainpage_poorzimfile)
{
const std::string expected_stdout(
"[INFO] Checking zim file data/zimfiles/poor.zim" "\n"
"[INFO] Zimcheck version is 3.0.0" "\n"
"[INFO] Zimcheck version is " VERSION "\n"
"[INFO] Searching for main page..." "\n"
"[ERROR] Missing mainpage:" "\n"
" Main Page Index stored in Archive Header: 4294967295" "\n"
Expand All @@ -590,7 +590,7 @@ TEST(zimcheck, empty_items_poorzimfile)
{
const std::string expected_stdout(
"[INFO] Checking zim file data/zimfiles/poor.zim" "\n"
"[INFO] Zimcheck version is 3.0.0" "\n"
"[INFO] Zimcheck version is " VERSION "\n"
"[INFO] Verifying Articles' content..." "\n"
"[ERROR] Empty articles:" "\n"
" Entry empty.html is empty" "\n"
Expand All @@ -611,7 +611,7 @@ TEST(zimcheck, internal_url_check_poorzimfile)
{
const std::string expected_stdout(
"[INFO] Checking zim file data/zimfiles/poor.zim" "\n"
"[INFO] Zimcheck version is 3.0.0" "\n"
"[INFO] Zimcheck version is " VERSION "\n"
"[INFO] Verifying Articles' content..." "\n"
"[ERROR] Invalid internal links found:" "\n"
" The following links:" "\n"
Expand All @@ -636,7 +636,7 @@ TEST(zimcheck, external_url_check_poorzimfile)
{
const std::string expected_stdout(
"[INFO] Checking zim file data/zimfiles/poor.zim" "\n"
"[INFO] Zimcheck version is 3.0.0" "\n"
"[INFO] Zimcheck version is " VERSION "\n"
"[INFO] Verifying Articles' content..." "\n"
"[ERROR] Invalid external links found:" "\n"
" http://a.io/pic.png is an external dependence in article external_link.html" "\n"
Expand All @@ -657,7 +657,7 @@ TEST(zimcheck, redundant_poorzimfile)
{
const std::string expected_stdout(
"[INFO] Checking zim file data/zimfiles/poor.zim" "\n"
"[INFO] Zimcheck version is 3.0.0" "\n"
"[INFO] Zimcheck version is " VERSION "\n"
"[INFO] Verifying Articles' content..." "\n"
"[INFO] Searching for redundant articles..." "\n"
" Verifying Similar Articles for redundancies..." "\n"
Expand All @@ -680,7 +680,7 @@ TEST(zimcheck, redirect_loop_poorzimfile)
{
const std::string expected_output(
"[INFO] Checking zim file data/zimfiles/poor.zim" "\n"
"[INFO] Zimcheck version is 3.0.0" "\n"
"[INFO] Zimcheck version is " VERSION "\n"
"[INFO] Checking for redirect loops..." "\n"
"[ERROR] Redirect loop(s) exist:" "\n"
" Redirect loop exists from entry redirect_loop.html" "\n"
Expand All @@ -704,7 +704,7 @@ TEST(zimcheck, redirect_loop_poorzimfile)

const std::string ALL_CHECKS_OUTPUT_ON_POORZIMFILE(
"[INFO] Checking zim file data/zimfiles/poor.zim" "\n"
"[INFO] Zimcheck version is 3.0.0" "\n"
"[INFO] Zimcheck version is " VERSION "\n"
"[INFO] Verifying ZIM-archive structure integrity..." "\n"
"[INFO] Avoiding redundant checksum test (already performed by the integrity check)." "\n"
"[INFO] Searching for metadata entries..." "\n"
Expand Down Expand Up @@ -775,7 +775,7 @@ TEST(zimcheck, json_bad_checksum)

ASSERT_EQ(
"{" "\n"
" \"zimcheck_version\" : \"3.0.0\"," "\n"
" \"zimcheck_version\" : \"" VERSION "\"," "\n"
" \"checks\" : [" "\n"
" \"checksum\"" "\n"
" ]," "\n"
Expand All @@ -802,7 +802,7 @@ TEST(zimcheck, json_poorzimfile)

ASSERT_EQ(
"{" "\n"
" \"zimcheck_version\" : \"3.0.0\"," "\n"
" \"zimcheck_version\" : \"" VERSION "\"," "\n"
" \"checks\" : [" "\n"
" \"checksum\"," "\n"
" \"integrity\"," "\n"
Expand Down

0 comments on commit 09fad0d

Please sign in to comment.