Improvements to GTest and GMock.

pull/15/head
Jussi Pakkanen 12 years ago
parent ce4f2f1bbe
commit ea3e8f1dd2
  1. 12
      dependencies.py
  2. 2
      test cases/frameworks/2 gtest/meson.build
  3. 2
      test cases/frameworks/3 gmock/meson.build

@ -265,6 +265,10 @@ class GTestDependency(Dependency):
print('Dependency GTest found: YES')
else:
print('Dependency GTest found: NO')
if kwargs.get('main', False):
self.sources = [self.all_src, self.main_src]
else:
self.sources = [self.all_src]
def found(self):
return os.path.exists(self.all_src)
@ -281,7 +285,7 @@ class GTestDependency(Dependency):
def get_version(self):
return '1.something_maybe'
def get_sources(self):
return [self.all_src, self.main_src]
return self.sources
class GMockDependency(Dependency):
def __init__(self, kwargs):
@ -306,8 +310,12 @@ class GMockDependency(Dependency):
self.is_found = True
self.compile_flags = ['-I' + self.src_include_dir]
self.link_flags = []
self.sources = [self.all_src]
if kwargs.get('main', False):
self.sources = [self.all_src, self.main_src]
else:
self.sources = [self.all_src]
print('Dependency GMock found: YES')
else:
print('Dependency GMock found: NO')
self.is_found = False

@ -1,6 +1,6 @@
project('gtest', 'cpp')
gtest = dependency('gtest')
gtest = dependency('gtest', main : true)
e = executable('testprog', 'test.cc', deps : gtest)
test('gtest test', e)

@ -3,7 +3,7 @@ project('gmock test', 'cpp')
# Using gmock without gtest is a pain so just
# don't support that then.
gtest = dependency('gtest')
gtest = dependency('gtest', main : true)
gmock = dependency('gmock')
e = executable('gmocktest', 'gmocktest.cc', deps : [gtest, gmock])

Loading…
Cancel
Save