William A. Kennington III | ef2c0b7 | 2022-08-24 15:12:53 -0700 | [diff] [blame] | 1 | gtests = { |
| 2 | 'cancel': [stdplus_dep, gtest_main_dep], |
| 3 | 'exception': [stdplus_dep, gtest_main_dep], |
William A. Kennington III | ece1943 | 2023-07-15 03:17:24 -0700 | [diff] [blame] | 4 | 'function_view': [stdplus_dep, gtest_main_dep], |
William A. Kennington III | ef2c0b7 | 2022-08-24 15:12:53 -0700 | [diff] [blame] | 5 | 'handle/copyable': [stdplus_dep, gtest_main_dep], |
| 6 | 'handle/managed': [stdplus_dep, gtest_main_dep], |
William A. Kennington III | 403cda2 | 2022-12-12 15:52:35 -0800 | [diff] [blame] | 7 | 'hash': [stdplus_dep, gtest_main_dep], |
William A. Kennington III | 85149ee | 2023-01-03 18:15:47 -0800 | [diff] [blame] | 8 | 'hash/array': [stdplus_dep, gtest_main_dep], |
William A. Kennington III | b07a2eb | 2023-01-03 18:14:40 -0800 | [diff] [blame] | 9 | 'hash/tuple': [stdplus_dep, gtest_main_dep], |
William A. Kennington III | b25086a | 2023-01-09 18:53:29 -0800 | [diff] [blame] | 10 | 'net/addr/ether': [stdplus_dep, gtest_main_dep], |
William A. Kennington III | 9330c87 | 2023-01-04 15:41:53 -0800 | [diff] [blame] | 11 | 'net/addr/ip': [stdplus_dep, gtest_main_dep], |
William A. Kennington III | be3fb71 | 2023-12-17 19:14:56 -0800 | [diff] [blame] | 12 | 'net/addr/sock': [stdplus_dep, gtest_main_dep], |
William A. Kennington III | 14dd4eb | 2023-01-12 10:51:12 -0800 | [diff] [blame] | 13 | 'net/addr/subnet': [stdplus_dep, gtest_main_dep], |
William A. Kennington III | 8c5f28c | 2022-12-07 01:21:36 -0800 | [diff] [blame] | 14 | 'numeric/endian': [stdplus_dep, gtest_main_dep], |
William A. Kennington III | cda3c1e | 2022-12-03 16:56:19 -0800 | [diff] [blame] | 15 | 'numeric/str': [stdplus_dep, gtest_main_dep], |
William A. Kennington III | cb9ddb6 | 2022-11-18 19:50:10 -0800 | [diff] [blame] | 16 | 'pinned': [stdplus_dep, gtest_main_dep], |
William A. Kennington III | 0475b6d | 2023-07-21 14:28:54 -0700 | [diff] [blame] | 17 | 'print': [stdplus_dep, gtest_main_dep], |
William A. Kennington III | ef2c0b7 | 2022-08-24 15:12:53 -0700 | [diff] [blame] | 18 | 'raw': [stdplus_dep, gmock_dep, gtest_main_dep], |
| 19 | 'signal': [stdplus_dep, gtest_main_dep], |
William A. Kennington III | 3c7107f | 2023-06-13 15:13:50 -0700 | [diff] [blame] | 20 | 'str/buf': [stdplus_dep, gtest_main_dep], |
William A. Kennington III | 6047970 | 2022-12-07 02:55:24 -0800 | [diff] [blame] | 21 | 'str/cat': [stdplus_dep, gtest_main_dep], |
William A. Kennington III | 385cd7d | 2023-06-07 13:39:53 -0700 | [diff] [blame] | 22 | 'str/cexpr': [stdplus_dep, gtest_main_dep], |
William A. Kennington III | 0e844d5 | 2022-12-06 23:57:32 -0800 | [diff] [blame] | 23 | 'str/conv': [stdplus_dep, gmock_dep, gtest_main_dep], |
William A. Kennington III | 521475e | 2022-12-12 16:51:44 -0800 | [diff] [blame] | 24 | 'str/maps': [stdplus_dep, gmock_dep, gtest_main_dep], |
William A. Kennington III | ef2c0b7 | 2022-08-24 15:12:53 -0700 | [diff] [blame] | 25 | 'util/cexec': [stdplus_dep, gtest_main_dep], |
William A. Kennington III | db1bdbc | 2023-01-09 16:02:13 -0800 | [diff] [blame] | 26 | 'variant': [stdplus_dep, gtest_main_dep], |
William A. Kennington III | f2ddf51 | 2022-09-20 15:36:44 -0700 | [diff] [blame] | 27 | 'zstring': [stdplus_dep, gtest_main_dep], |
William A. Kennington III | 61a81bc | 2022-09-19 17:46:49 -0700 | [diff] [blame] | 28 | 'zstring_view': [stdplus_dep, gtest_main_dep], |
William A. Kennington III | ef2c0b7 | 2022-08-24 15:12:53 -0700 | [diff] [blame] | 29 | } |
William A. Kennington III | d7acddd | 2022-07-13 16:41:11 -0700 | [diff] [blame] | 30 | |
William A. Kennington III | 5a52802 | 2021-04-28 12:52:43 -0700 | [diff] [blame] | 31 | if has_dl |
William A. Kennington III | ef2c0b7 | 2022-08-24 15:12:53 -0700 | [diff] [blame] | 32 | gtests += { |
| 33 | 'dl': [stdplus_dl_dep, gtest_main_dep], |
| 34 | } |
William A. Kennington III | 5a52802 | 2021-04-28 12:52:43 -0700 | [diff] [blame] | 35 | elif build_tests.enabled() |
| 36 | error('Not testing libdl feature') |
| 37 | else |
| 38 | warning('Not testing libdl feature') |
| 39 | endif |
| 40 | |
William A. Kennington III | eac9d47 | 2020-08-03 13:57:14 -0700 | [diff] [blame] | 41 | if has_fd |
William A. Kennington III | ef2c0b7 | 2022-08-24 15:12:53 -0700 | [diff] [blame] | 42 | gtests += { |
| 43 | 'fd/dupable': [stdplus_fd_dep], |
| 44 | 'fd/managed': [stdplus_fd_dep], |
William A. Kennington III | aa4fcfc | 2022-08-23 16:35:10 -0700 | [diff] [blame] | 45 | 'fd/fmt': [stdplus_fd_dep, stdplus_dep, gtest_main_dep], |
William A. Kennington III | ef2c0b7 | 2022-08-24 15:12:53 -0700 | [diff] [blame] | 46 | 'fd/intf': [stdplus_fd_dep], |
| 47 | 'fd/impl': [stdplus_fd_dep], |
| 48 | 'fd/line': [stdplus_fd_dep, stdplus_dep, gmock_dep, gtest_main_dep], |
| 49 | 'fd/mmap': [stdplus_fd_dep, gtest_main_dep], |
| 50 | 'fd/mock': [stdplus_fd_dep, gmock_dep, gtest_main_dep], |
William A. Kennington III | 93ae970 | 2023-12-22 16:41:17 -0800 | [diff] [blame] | 51 | 'fd/ops': [stdplus_fd_dep, stdplus_dep, gmock_dep, gtest_main_dep], |
William A. Kennington III | ef2c0b7 | 2022-08-24 15:12:53 -0700 | [diff] [blame] | 52 | } |
| 53 | if has_gtest |
| 54 | gtests += { |
William A. Kennington III | aa4fcfc | 2022-08-23 16:35:10 -0700 | [diff] [blame] | 55 | 'fd/atomic': [stdplus_fd_dep, stdplus_gtest_dep, gtest_main_dep], |
William A. Kennington III | ef2c0b7 | 2022-08-24 15:12:53 -0700 | [diff] [blame] | 56 | } |
| 57 | elif build_tests.enabled() |
William A. Kennington III | aa4fcfc | 2022-08-23 16:35:10 -0700 | [diff] [blame] | 58 | error('Not testing fd/atomic feature') |
William A. Kennington III | ef2c0b7 | 2022-08-24 15:12:53 -0700 | [diff] [blame] | 59 | else |
William A. Kennington III | aa4fcfc | 2022-08-23 16:35:10 -0700 | [diff] [blame] | 60 | warning('Not testing fd/atomic feature') |
William A. Kennington III | ef2c0b7 | 2022-08-24 15:12:53 -0700 | [diff] [blame] | 61 | endif |
William A. Kennington III | 4575424 | 2021-04-28 12:48:31 -0700 | [diff] [blame] | 62 | elif build_tests.enabled() |
| 63 | error('Not testing file descriptor feature') |
William A. Kennington III | eac9d47 | 2020-08-03 13:57:14 -0700 | [diff] [blame] | 64 | else |
| 65 | warning('Not testing file descriptor feature') |
| 66 | endif |
| 67 | |
William A. Kennington III | 5c20da2 | 2021-06-18 16:44:55 -0700 | [diff] [blame] | 68 | if has_io_uring |
William A. Kennington III | ef2c0b7 | 2022-08-24 15:12:53 -0700 | [diff] [blame] | 69 | gtests += { |
| 70 | 'io_uring': [stdplus_io_uring_dep, stdplus_dep, gmock_dep, gtest_main_dep], |
| 71 | } |
William A. Kennington III | 5c20da2 | 2021-06-18 16:44:55 -0700 | [diff] [blame] | 72 | elif build_tests.enabled() |
| 73 | error('Not testing io_uring feature') |
| 74 | else |
| 75 | warning('Not testing io_uring feature') |
| 76 | endif |
| 77 | |
William A. Kennington III | 953de36 | 2022-07-13 17:32:55 -0700 | [diff] [blame] | 78 | if has_gtest |
William A. Kennington III | ef2c0b7 | 2022-08-24 15:12:53 -0700 | [diff] [blame] | 79 | gtests += { |
| 80 | 'gtest/tmp': [stdplus_gtest_dep, gtest_main_dep], |
| 81 | } |
William A. Kennington III | 953de36 | 2022-07-13 17:32:55 -0700 | [diff] [blame] | 82 | elif build_tests.enabled() |
| 83 | error('Not testing gtest lib feature') |
| 84 | else |
| 85 | warning('Not testing gtest lib feature') |
| 86 | endif |
| 87 | |
William A. Kennington III | b467460 | 2022-08-24 14:54:37 -0700 | [diff] [blame] | 88 | add_test_setup( |
| 89 | 'stdplus', |
| 90 | exe_wrapper: run_with_tmp, |
| 91 | env: {'TMPTMPL': 'stdplus-test.XXXXXXXXXX'}, |
| 92 | is_default: true) |
| 93 | |
| 94 | add_test_setup( |
| 95 | 'valgrind', |
| 96 | exe_wrapper: [run_with_tmp, 'valgrind'], |
| 97 | env: {'TMPTMPL': 'stdplus-test.XXXXXXXXXX'}) |
| 98 | |
William A. Kennington III | 953de36 | 2022-07-13 17:32:55 -0700 | [diff] [blame] | 99 | if gtest_dep.found() and gmock_dep.found() |
William A. Kennington III | ef2c0b7 | 2022-08-24 15:12:53 -0700 | [diff] [blame] | 100 | foreach t, deps : gtests |
William A. Kennington III | 953de36 | 2022-07-13 17:32:55 -0700 | [diff] [blame] | 101 | test( |
| 102 | t, |
William A. Kennington III | b467460 | 2022-08-24 14:54:37 -0700 | [diff] [blame] | 103 | executable( |
William A. Kennington III | 953de36 | 2022-07-13 17:32:55 -0700 | [diff] [blame] | 104 | t.underscorify(), t + '.cpp', |
| 105 | build_by_default: false, |
| 106 | implicit_include_directories: false, |
William A. Kennington III | 1cad7d7 | 2023-06-06 13:50:01 -0700 | [diff] [blame] | 107 | cpp_args: '-Wno-missing-braces', |
William A. Kennington III | ef2c0b7 | 2022-08-24 15:12:53 -0700 | [diff] [blame] | 108 | dependencies: deps)) |
William A. Kennington III | 83af3fa | 2021-01-31 15:22:54 -0800 | [diff] [blame] | 109 | endforeach |
| 110 | endif |