blob: 51993de7855b05014f93c3cf32b269862ebe9719 [file] [log] [blame]
William A. Kennington III2f8444c2020-06-03 13:39:49 -07001gtest = dependency('gtest', main: true, disabler: true, required: false)
2gmock = dependency('gmock', disabler: true, required: false)
3if not gtest.found() or not gmock.found()
4 gtest_proj = import('cmake').subproject('googletest', required: false)
5 if gtest_proj.found()
6 gtest = declare_dependency(
7 dependencies: [
8 dependency('threads'),
9 gtest_proj.dependency('gtest'),
10 gtest_proj.dependency('gtest_main'),
11 ])
12 gmock = gtest_proj.dependency('gmock')
13 else
14 assert(not build_tests.enabled(), 'Googletest is required')
15 endif
16endif
William A. Kennington III15658972019-03-27 19:44:36 -070017
18tests = [
19 'chip',
20 'event',
21 'handle',
22 'internal/fd',
23 'mocks',
24 'utility/aspeed',
25]
26
27foreach t : tests
28 test(t, executable(t.underscorify(), t + '.cpp',
William A. Kennington III15658972019-03-27 19:44:36 -070029 implicit_include_directories: false,
William A. Kennington III48e62882019-04-03 15:36:01 -070030 dependencies: [gpioplus, gtest, gmock]))
William A. Kennington III15658972019-03-27 19:44:36 -070031endforeach