xref: /openbmc/openpower-hw-diags/test/meson.build (revision 8018391d05873634c1771ebfffca398b30d7ca90)
1*8018391dSZane Shelley# Get the gtest/gmock dependencies.
2*8018391dSZane Shelleygtest_dep = dependency('gtest', main: true, disabler: true, required: false)
3*8018391dSZane Shelleygmock_dep = dependency('gmock', disabler: true, required: false)
4*8018391dSZane Shelleyif not gtest_dep.found() or not gmock_dep.found()
5*8018391dSZane Shelley    cmake = import('cmake')
6*8018391dSZane Shelley    gtest_proj = cmake.subproject('googletest',
7*8018391dSZane Shelley                                  required: false)
8*8018391dSZane Shelley    if gtest_proj.found()
9*8018391dSZane Shelley        gtest_dep = declare_dependency(
10*8018391dSZane Shelley            dependencies: [
11*8018391dSZane Shelley                dependency('threads'),
12*8018391dSZane Shelley                gtest_proj.dependency('gtest'),
13*8018391dSZane Shelley                gtest_proj.dependency('gtest_main'),
14*8018391dSZane Shelley            ]
15*8018391dSZane Shelley        )
16*8018391dSZane Shelley        gmock_dep = gtest_proj.dependency('gmock')
17*8018391dSZane Shelley    else
18*8018391dSZane Shelley        assert(not get_option('tests').enabled(),
19*8018391dSZane Shelley               'Googletest is required if tests are enabled')
20*8018391dSZane Shelley    endif
21*8018391dSZane Shelleyendif
22*8018391dSZane Shelley
230c44c2feSZane Shelleytest_arg = [
240c44c2feSZane Shelley    '-DTEST_TRACE',
250c44c2feSZane Shelley]
260c44c2feSZane Shelley
279ae5ca41SBen Tyner# end2end code exerciser for experiment and testing
289ae5ca41SBen Tynersubdir('end2end')
299ae5ca41SBen Tyner
30248cbf83SZane Shelleytests = [
31d26298b1SZane Shelley  'bin_stream_test',
32982f1722SZane Shelley  'ffdc_file_test',
330b8368cbSZane Shelley  'resolution_test',
34248cbf83SZane Shelley]
35248cbf83SZane Shelley
36979e2871SZane Shelleyanalyzer_src = files(
37979e2871SZane Shelley  '../analyzer/service_data.cpp',
38979e2871SZane Shelley)
39979e2871SZane Shelley
40248cbf83SZane Shelleyforeach t : tests
41979e2871SZane Shelley    test(t, executable(t.underscorify(), [ t + '.cpp', analyzer_src ],
42982f1722SZane Shelley                       link_with : [ util_lib ],
43*8018391dSZane Shelley                       dependencies : [ libhei_dep, gtest_dep ],
448af9e46fSZane Shelley                       cpp_args : test_arg,
458af9e46fSZane Shelley                       include_directories : incdir))
46248cbf83SZane Shelleyendforeach
47