William A. Kennington III | 245495e | 2020-02-13 13:07:30 -0800 | [diff] [blame] | 1 | gtests = [ |
William A. Kennington III | 458aeae | 2021-06-14 15:07:16 -0700 | [diff] [blame] | 2 | 'cancel', |
William A. Kennington III | 9a70f4e | 2021-05-01 17:16:57 -0700 | [diff] [blame] | 3 | 'exception', |
William A. Kennington III | e847ef8 | 2018-11-02 17:29:15 -0700 | [diff] [blame] | 4 | 'handle/copyable', |
William A. Kennington III | 7a5e232 | 2018-11-02 17:28:35 -0700 | [diff] [blame] | 5 | 'handle/managed', |
William A. Kennington III | 6c15d9a | 2022-08-24 13:45:42 -0700 | [diff] [blame] | 6 | 'raw', |
William A. Kennington III | 0bd1370 | 2022-08-24 13:33:34 -0700 | [diff] [blame] | 7 | 'signal', |
William A. Kennington III | bff0b0f | 2018-11-16 19:56:10 -0800 | [diff] [blame] | 8 | 'util/cexec', |
William A. Kennington III | 4ef36e7 | 2019-06-27 12:48:59 -0700 | [diff] [blame] | 9 | 'util/string', |
William A. Kennington III | 15982f6 | 2019-01-31 14:43:41 -0800 | [diff] [blame] | 10 | ] |
| 11 | |
William A. Kennington III | d7acddd | 2022-07-13 16:41:11 -0700 | [diff] [blame] | 12 | gtest_deps = [ |
| 13 | stdplus_dep, |
William A. Kennington III | 953de36 | 2022-07-13 17:32:55 -0700 | [diff] [blame] | 14 | gtest_main_dep, |
| 15 | gmock_dep, |
William A. Kennington III | d7acddd | 2022-07-13 16:41:11 -0700 | [diff] [blame] | 16 | ] |
| 17 | |
William A. Kennington III | 5a52802 | 2021-04-28 12:52:43 -0700 | [diff] [blame] | 18 | if has_dl |
| 19 | gtests += [ |
| 20 | 'dl', |
| 21 | ] |
William A. Kennington III | d7acddd | 2022-07-13 16:41:11 -0700 | [diff] [blame] | 22 | |
| 23 | gtest_deps += [ |
| 24 | stdplus_dl_dep, |
| 25 | ] |
William A. Kennington III | 5a52802 | 2021-04-28 12:52:43 -0700 | [diff] [blame] | 26 | elif build_tests.enabled() |
| 27 | error('Not testing libdl feature') |
| 28 | else |
| 29 | warning('Not testing libdl feature') |
| 30 | endif |
| 31 | |
William A. Kennington III | eac9d47 | 2020-08-03 13:57:14 -0700 | [diff] [blame] | 32 | if has_fd |
| 33 | gtests += [ |
| 34 | 'fd/dupable', |
| 35 | 'fd/managed', |
William A. Kennington III | 4f5711c | 2022-08-12 17:01:53 -0700 | [diff] [blame] | 36 | 'fd/fmt', |
William A. Kennington III | eac9d47 | 2020-08-03 13:57:14 -0700 | [diff] [blame] | 37 | 'fd/intf', |
| 38 | 'fd/impl', |
William A. Kennington III | 9a512c9 | 2022-08-12 15:15:55 -0700 | [diff] [blame] | 39 | 'fd/line', |
William A. Kennington III | 891e6a3 | 2022-05-17 16:35:03 -0700 | [diff] [blame] | 40 | 'fd/mmap', |
William A. Kennington III | eac9d47 | 2020-08-03 13:57:14 -0700 | [diff] [blame] | 41 | 'fd/mock', |
| 42 | 'fd/ops', |
| 43 | ] |
William A. Kennington III | d7acddd | 2022-07-13 16:41:11 -0700 | [diff] [blame] | 44 | |
| 45 | gtest_deps += [ |
| 46 | stdplus_fd_dep, |
| 47 | ] |
William A. Kennington III | 4575424 | 2021-04-28 12:48:31 -0700 | [diff] [blame] | 48 | elif build_tests.enabled() |
| 49 | error('Not testing file descriptor feature') |
William A. Kennington III | eac9d47 | 2020-08-03 13:57:14 -0700 | [diff] [blame] | 50 | else |
| 51 | warning('Not testing file descriptor feature') |
| 52 | endif |
| 53 | |
William A. Kennington III | 5c20da2 | 2021-06-18 16:44:55 -0700 | [diff] [blame] | 54 | if has_io_uring |
| 55 | gtests += [ |
| 56 | 'io_uring', |
| 57 | ] |
William A. Kennington III | d7acddd | 2022-07-13 16:41:11 -0700 | [diff] [blame] | 58 | |
| 59 | gtest_deps += [ |
| 60 | stdplus_io_uring_dep, |
| 61 | ] |
William A. Kennington III | 5c20da2 | 2021-06-18 16:44:55 -0700 | [diff] [blame] | 62 | elif build_tests.enabled() |
| 63 | error('Not testing io_uring feature') |
| 64 | else |
| 65 | warning('Not testing io_uring feature') |
| 66 | endif |
| 67 | |
William A. Kennington III | 953de36 | 2022-07-13 17:32:55 -0700 | [diff] [blame] | 68 | if has_gtest |
| 69 | gtests += [ |
| 70 | 'gtest/tmp', |
| 71 | ] |
| 72 | |
| 73 | gtest_deps += [ |
| 74 | stdplus_gtest_dep, |
| 75 | ] |
| 76 | elif build_tests.enabled() |
| 77 | error('Not testing gtest lib feature') |
| 78 | else |
| 79 | warning('Not testing gtest lib feature') |
| 80 | endif |
| 81 | |
| 82 | if gtest_dep.found() and gmock_dep.found() |
William A. Kennington III | 83af3fa | 2021-01-31 15:22:54 -0800 | [diff] [blame] | 83 | foreach t : gtests |
William A. Kennington III | 953de36 | 2022-07-13 17:32:55 -0700 | [diff] [blame] | 84 | test( |
| 85 | t, |
William A. Kennington III | 2030ea5 | 2022-07-19 17:06:39 -0700 | [diff] [blame] | 86 | run_with_tmp, |
William A. Kennington III | 953de36 | 2022-07-13 17:32:55 -0700 | [diff] [blame] | 87 | env: {'TMPTMPL': 'stdplus-test.XXXXXXXXXX'}, |
| 88 | args: executable( |
| 89 | t.underscorify(), t + '.cpp', |
| 90 | build_by_default: false, |
| 91 | implicit_include_directories: false, |
| 92 | dependencies: gtest_deps)) |
William A. Kennington III | 83af3fa | 2021-01-31 15:22:54 -0800 | [diff] [blame] | 93 | endforeach |
| 94 | endif |