blob: 730c19aff3764b29b7d65f9f08a834d4ccc0aa9c [file] [log] [blame]
Zane Shelley80183912021-12-21 11:52:25 -06001# Get the gtest/gmock dependencies.
2gtest_dep = dependency('gtest', main: true, disabler: true, required: false)
3gmock_dep = dependency('gmock', disabler: true, required: false)
4if not gtest_dep.found() or not gmock_dep.found()
5 cmake = import('cmake')
6 gtest_proj = cmake.subproject('googletest',
7 required: false)
8 if gtest_proj.found()
9 gtest_dep = declare_dependency(
10 dependencies: [
11 dependency('threads'),
12 gtest_proj.dependency('gtest'),
13 gtest_proj.dependency('gtest_main'),
14 ]
15 )
16 gmock_dep = gtest_proj.dependency('gmock')
17 else
18 assert(not get_option('tests').enabled(),
19 'Googletest is required if tests are enabled')
20 endif
21endif
22
Zane Shelley0c44c2f2020-06-05 17:14:31 -050023test_arg = [
24 '-DTEST_TRACE',
25]
26
Ben Tyner9ae5ca42020-02-28 13:13:50 -060027# end2end code exerciser for experiment and testing
28subdir('end2end')
29
Zane Shelley248cbf82019-05-03 17:07:18 -050030tests = [
Zane Shelleyd26298b2021-01-28 16:49:19 -060031 'bin_stream_test',
Zane Shelley982f1722021-03-25 10:56:37 -050032 'ffdc_file_test',
Zane Shelley0b8368c2021-03-18 17:33:41 -050033 'resolution_test',
Zane Shelley248cbf82019-05-03 17:07:18 -050034]
35
Zane Shelley979e2872021-09-20 22:46:06 -050036analyzer_src = files(
37 '../analyzer/service_data.cpp',
38)
39
Zane Shelley80183912021-12-21 11:52:25 -060040foreach t : tests
41 test(t, executable(t.underscorify(), [ t + '.cpp', analyzer_src ],
42 link_with : [ util_lib ],
43 dependencies : [ libhei_dep, gtest_dep ],
44 cpp_args : test_arg,
45 include_directories : incdir))
46endforeach