2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-22 01:49:48 +00:00

[#3732] Use gtest wrap

This commit is contained in:
Andrei Pavel 2025-04-10 20:59:43 +03:00
parent d226b29fd3
commit bdf37d0d3f
No known key found for this signature in database
GPG Key ID: D4E804481939CB21
3 changed files with 36 additions and 10 deletions

View File

@ -244,10 +244,15 @@ if netconf_opt.enabled() and NETCONF_DEP.get_variable(
error('Dependency not found: NETCONF.')
endif
GTEST_DEP = dependency(
'gtest',
required: TESTS_OPT.enabled() or FUZZ_OPT.enabled(),
)
# GTEST_DEP = dependency(
# 'gtest',
# required: TESTS_OPT.enabled() or FUZZ_OPT.enabled(),
# )
GTEST_DEP = disabler()
if TESTS_OPT.enabled() or FUZZ_OPT.enabled()
gtest_proj = subproject('gtest')
GTEST_DEP = gtest_proj.get_variable('gtest_dep')
endif
# Crypto
if crypto_opt == 'botan'
@ -469,12 +474,15 @@ endif
conf_data.set('HAVE_AFL', have_afl)
if GTEST_DEP.found()
result = cpp.run(
fs.read('compiler-checks/have-create-unified-diff.cc'),
name: 'HAVE_CREATE_UNIFIED_DIFF',
dependencies: [GTEST_DEP],
)
conf_data.set('HAVE_CREATE_UNIFIED_DIFF', result.returncode() == 0)
# Wrap dependencies cannot be used in compiler checks: https://github.com/mesonbuild/meson/issues/11575
# We can safely assume that googletest 1.15.2 has CreateUnifiedDiff though.
# result = cpp.run(
# fs.read('compiler-checks/have-create-unified-diff.cc'),
# name: 'HAVE_CREATE_UNIFIED_DIFF',
# dependencies: [GTEST_DEP],
# )
# conf_data.set('HAVE_CREATE_UNIFIED_DIFF', result.returncode() == 0)
conf_data.set('HAVE_CREATE_UNIFIED_DIFF', true)
endif
if KRB5_DEP.found()

2
subprojects/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/googletest-1.15.2
/packagecache

16
subprojects/gtest.wrap Normal file
View File

@ -0,0 +1,16 @@
[wrap-file]
directory = googletest-1.15.2
source_url = https://github.com/google/googletest/archive/refs/tags/v1.15.2.tar.gz
source_filename = gtest-1.15.2.tar.gz
source_hash = 7b42b4d6ed48810c5362c265a17faebe90dc2373c885e5216439d37927f02926
patch_filename = gtest_1.15.2-4_patch.zip
patch_url = https://wrapdb.mesonbuild.com/v2/gtest_1.15.2-4/get_patch
patch_hash = a5151324b97e6a98fa7a0e8095523e6d5c4bb3431210d6ac4ad9800c345acf40
source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/gtest_1.15.2-4/gtest-1.15.2.tar.gz
wrapdb_version = 1.15.2-4
[provide]
gtest = gtest_dep
gtest_main = gtest_main_dep
gmock = gmock_dep
gmock_main = gmock_main_dep