Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: meson.build

Issue 29680720: Issue 6221 - Add native tests. (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Review comments addressed Created Jan. 29, 2018, 4:56 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: meson.build
===================================================================
--- a/meson.build
+++ b/meson.build
@@ -187,14 +187,40 @@
depend_files: [ JS_LIBRARY ],
command: [
emcc, '-o', output_file,
'--post-js', bindings_output,
'--js-library', JS_LIBRARY,
'@INPUT@'
] + compiler_args + optional_args)
else
+ GTEST_DIR = join_paths('third-party', 'googletest', 'googletest')
+ GTEST_PARAMS = []
+ compiler = meson.get_compiler('cpp')
+ if compiler.has_argument('-pthread')
+ GTEST_PARAMS += '-pthread'
+ endif
+
+ test_sources = [
+ 'test/compiled/abptest.cpp',
+ 'test/compiled/String.cpp',
+ 'test/compiled/StringMap.cpp',
+ 'test/compiled/RegExp.cpp',
+ ]
+
adblockpluscore = library('adblockpluscore', shared_sources,
native_sources,
cpp_args: ADDITIONAL_PARAMS + CORE_PARAMS,
link_args: LINK_PARAMS)
+ gtest = static_library('gtest', files(join_paths(GTEST_DIR, 'src', 'gtest-all.cc')),
+ include_directories: [
+ include_directories(join_paths(GTEST_DIR, 'include'), is_system: true),
+ include_directories(GTEST_DIR)
+ ],
+ cpp_args: GTEST_PARAMS)
+ abptest = executable('abptest', test_sources,
+ cpp_args: ADDITIONAL_PARAMS + CORE_PARAMS,
+ include_directories: include_directories(join_paths(GTEST_DIR, 'include')),
+ link_args: LINK_PARAMS,
+ link_with: [ adblockpluscore, gtest ])
+ test('abptest', abptest)
endif
« no previous file with comments | « dependencies ('k') | test/compiled/RegExp.cpp » ('j') | test/compiled/RegExp.cpp » ('J')

Powered by Google App Engine
This is Rietveld