mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-26 10:11:30 +00:00
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
This commit is contained in:
@ -11,7 +11,8 @@ tests = [
|
||||
'pathTools',
|
||||
'kiwixserve',
|
||||
'book',
|
||||
'manager'
|
||||
'manager',
|
||||
'server'
|
||||
]
|
||||
|
||||
|
||||
@ -21,8 +22,15 @@ gtest_dep = dependency('gtest',
|
||||
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],
|
||||
|
Reference in New Issue
Block a user