Ratan Gupta | 8af2a89 | 2021-02-02 05:48:18 -0600 | [diff] [blame] | 1 | ################################################################################# |
| 2 | # Enforce the test dependencies when tests are enabled |
Patrick Williams | 76ca53e | 2025-03-03 11:08:20 -0500 | [diff] [blame] | 3 | gtest = dependency( |
| 4 | 'gtest', |
| 5 | main: true, |
| 6 | disabler: true, |
| 7 | required: get_option('tests'), |
| 8 | ) |
| 9 | gmock = dependency('gmock', required: get_option('tests')) |
Ratan Gupta | 8af2a89 | 2021-02-02 05:48:18 -0600 | [diff] [blame] | 10 | |
| 11 | ################################################################################## |
| 12 | # declare the test sources |
| 13 | test_list = [ |
Patrick Williams | 76ca53e | 2025-03-03 11:08:20 -0500 | [diff] [blame] | 14 | 'TestBmcEpoch.cpp', |
| 15 | 'TestManager.cpp', |
| 16 | 'TestUtils.cpp', |
| 17 | 'mocked_property_change_listener.hpp', |
Ratan Gupta | 8af2a89 | 2021-02-02 05:48:18 -0600 | [diff] [blame] | 18 | ] |
| 19 | |
| 20 | ################################################################################### |
| 21 | # Run the tests |
Patrick Williams | 76ca53e | 2025-03-03 11:08:20 -0500 | [diff] [blame] | 22 | foreach tests : test_list |
| 23 | test_name = tests.split('.')[0] |
| 24 | test( |
| 25 | test_name, |
| 26 | executable( |
| 27 | test_name, |
| 28 | tests, |
| 29 | include_directories: ['.', '../'], |
| 30 | link_with: libtimemanager, |
| 31 | dependencies: [gtest, gmock] + deps, |
| 32 | ), |
| 33 | ) |
Ratan Gupta | 8af2a89 | 2021-02-02 05:48:18 -0600 | [diff] [blame] | 34 | endforeach |
| 35 | |