From f5458edff6f4c898371a721c4909f13ee05cbcdf Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Wed, 20 Dec 2017 15:22:14 -0800 Subject: [PATCH] tests: skip gmock test if gtest or gmock not installed --- test cases/frameworks/3 gmock/meson.build | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test cases/frameworks/3 gmock/meson.build b/test cases/frameworks/3 gmock/meson.build index 341f9d749..516547fc7 100644 --- a/test cases/frameworks/3 gmock/meson.build +++ b/test cases/frameworks/3 gmock/meson.build @@ -3,8 +3,14 @@ project('gmock test', 'cpp') # Using gmock without gtest is a pain so just # don't support that then. -gtest = dependency('gtest', main : true) -gmock = dependency('gmock') +gtest = dependency('gtest', main : true, required : false) +if not gtest.found() + error('MESON_SKIP_TEST: gtest not installed.') +endif +gmock = dependency('gmock', required : false) +if not gmock.found() + error('MESON_SKIP_TEST: gmock not installed.') +endif e = executable('gmocktest', 'gmocktest.cc', dependencies : [gtest, gmock]) test('gmock test', e)