Jie Yang | b988dbb | 2021-08-06 18:34:49 -0700 | [diff] [blame] | 1 | gtest = dependency('gtest', main: true, disabler: true, required: get_option('tests')) |
| 2 | gmock = dependency('gmock', disabler: true, required: get_option('tests')) |
| 3 | |
| 4 | test_dep = declare_dependency( |
| 5 | include_directories: include_directories('.'), |
| 6 | dependencies: [gtest, gmock]) |
| 7 | |
| 8 | tests = [ |
| 9 | 'parse_config_unittest', |
| 10 | 'sys_file_unittest', |
| 11 | 'handler_unittest', |
| 12 | 'handler_open_unittest', |
| 13 | 'handler_readwrite_unittest', |
| 14 | 'handler_commit_unittest', |
| 15 | 'handler_stat_unittest', |
| 16 | ] |
| 17 | |
| 18 | foreach t : tests |
| 19 | test( |
| 20 | t, |
| 21 | executable( |
| 22 | t.underscorify(), |
| 23 | t + '.cpp', |
| 24 | implicit_include_directories: false, |
| 25 | dependencies: [binarystoreblob_dep, test_dep])) |
| 26 | endforeach |