Files
libkiwix/test/meson.build
Veloman Yunkan 9bf6d0621f Introducing 1st real unit test of the server
Added a new unit test 'test/server.cpp'. The pre-existing unit test
test/kiwixserve.cpp tests kiwixlib indirectly by running the kiwix-serve
executable which may be built with another version of the library.

Included with this commit is the cpp-httplib C++ HTTP/HTTPS library
(https://github.com/yhirose/cpp-httplib, v0.5.11).
The new file test/httplib.h was copied from
https://raw.githubusercontent.com/yhirose/cpp-httplib/v0.5.11/httplib.h
2020-04-29 15:39:18 +04:00

41 lines
1.2 KiB
Meson

configure_file(input : 'data/example.zim',
output : 'example.zim',
copy: true )
tests = [
'parseUrl',
'library',
'regex',
'tagParsing',
'stringTools',
'pathTools',
'kiwixserve',
'book',
'manager',
'server'
]
gtest_dep = dependency('gtest',
main:true,
fallback: ['gtest', 'gtest_main_dep'],
required:false)
if gtest_dep.found() and not meson.is_cross_build()
configure_file(input : 'data/wikipedia_en_ray_charles_mini_2020-03.zim',
output : 'zimfile.zim',
copy: true )
foreach test_name : tests
# XXX: implicit_include_directories must be set to false, otherwise
# XXX: '#include <regex>' includes the regex unit test binary
test_exe = executable(test_name, [test_name+'.cpp'],
implicit_include_directories: false,
link_with : kiwixlib,
link_args: extra_link_args,
dependencies : all_deps + [gtest_dep],
build_rpath : '$ORIGIN')
test(test_name, test_exe)
endforeach
endif