diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2019-01-09 19:38:58 +0100 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2019-01-09 19:38:58 +0100 |
commit | 3d2ae07c455c0e423c64f19e445518427a5684fa (patch) | |
tree | 58f6b47c3db33658a6f2e605fd021f08d1fa9964 /lib/urlfilter/meson.build | |
parent | Add assorted unfished doc files to repo (diff) | |
download | smolbote-3d2ae07c455c0e423c64f19e445518427a5684fa.tar.xz |
Rewrite lib/urlfilter
- Make HostList and AdBlockList implementations independent from each
other
- Move urlfilter tests to lib/urlfilter
Diffstat (limited to 'lib/urlfilter/meson.build')
-rw-r--r-- | lib/urlfilter/meson.build | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/lib/urlfilter/meson.build b/lib/urlfilter/meson.build index 1f4f47c..b017eb5 100644 --- a/lib/urlfilter/meson.build +++ b/lib/urlfilter/meson.build @@ -1,19 +1,26 @@ -urlfilter_inc = include_directories('.') - -urlfilter_moc = qt5.preprocess( - moc_headers: 'filtertree.h', - dependencies: dep_qt5 -) - urlfilter_lib = static_library('urlfilter', - ['filtertree.cpp', 'filterleaf.cpp', urlfilter_moc, - 'domain.cpp', 'domain.h', - 'formats/adblockrule.cpp', 'formats/adblockrule_parse.cpp', 'formats/hostlistrule.cpp', - 'formats/adblocklist.cpp'], + ['urlfilter.h', 'matcher.h', + 'hostlist/hostlist.cpp', 'hostlist/hostlist.h', + 'adblock/adblocklist.cpp', 'adblock/adblocklist.h', 'adblock/parser.cpp', 'adblock/parser.h'], dependencies: dep_qt5 ) dep_urlfilter = declare_dependency( - include_directories: urlfilter_inc, + include_directories: include_directories('.'), link_with: urlfilter_lib ) + +if get_option('testing').enabled() + test('urlfilter: matcher', + executable('urlfilter-matcher', dependencies: [dep_qt5, dep_gtest, dep_urlfilter], sources: ['test/matcher.cpp']), + workdir: meson.current_source_dir() / 'test' + ) + test('urlfilter: host list', + executable('urlfilter-hostlist', dependencies: [dep_qt5, dep_gtest, dep_urlfilter], sources: ['test/hostlist.cpp']), + workdir: meson.current_source_dir() / 'test' + ) + test('urlfilter: adblock list', + executable('urlfilter-adblocklist', dependencies: [dep_qt5, dep_gtest, dep_urlfilter], sources: ['test/adblock.cpp']), + workdir: meson.current_source_dir() / 'test' + ) +endif |