blob: 378e6668d345202d4fab15bd0e4653c2dc0bedb9 [file] [log] [blame]
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -07001gtests = {
2 'cancel': [stdplus_dep, gtest_main_dep],
3 'exception': [stdplus_dep, gtest_main_dep],
William A. Kennington IIIece19432023-07-15 03:17:24 -07004 'function_view': [stdplus_dep, gtest_main_dep],
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -07005 'handle/copyable': [stdplus_dep, gtest_main_dep],
6 'handle/managed': [stdplus_dep, gtest_main_dep],
William A. Kennington III403cda22022-12-12 15:52:35 -08007 'hash': [stdplus_dep, gtest_main_dep],
William A. Kennington III85149ee2023-01-03 18:15:47 -08008 'hash/array': [stdplus_dep, gtest_main_dep],
William A. Kennington IIIb07a2eb2023-01-03 18:14:40 -08009 'hash/tuple': [stdplus_dep, gtest_main_dep],
William A. Kennington IIIb25086a2023-01-09 18:53:29 -080010 'net/addr/ether': [stdplus_dep, gtest_main_dep],
William A. Kennington III9330c872023-01-04 15:41:53 -080011 'net/addr/ip': [stdplus_dep, gtest_main_dep],
William A. Kennington IIIbe3fb712023-12-17 19:14:56 -080012 'net/addr/sock': [stdplus_dep, gtest_main_dep],
William A. Kennington III14dd4eb2023-01-12 10:51:12 -080013 'net/addr/subnet': [stdplus_dep, gtest_main_dep],
William A. Kennington III8c5f28c2022-12-07 01:21:36 -080014 'numeric/endian': [stdplus_dep, gtest_main_dep],
William A. Kennington IIIcda3c1e2022-12-03 16:56:19 -080015 'numeric/str': [stdplus_dep, gtest_main_dep],
William A. Kennington IIIcb9ddb62022-11-18 19:50:10 -080016 'pinned': [stdplus_dep, gtest_main_dep],
William A. Kennington III0475b6d2023-07-21 14:28:54 -070017 'print': [stdplus_dep, gtest_main_dep],
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070018 'raw': [stdplus_dep, gmock_dep, gtest_main_dep],
19 'signal': [stdplus_dep, gtest_main_dep],
William A. Kennington III3c7107f2023-06-13 15:13:50 -070020 'str/buf': [stdplus_dep, gtest_main_dep],
William A. Kennington III60479702022-12-07 02:55:24 -080021 'str/cat': [stdplus_dep, gtest_main_dep],
William A. Kennington III385cd7d2023-06-07 13:39:53 -070022 'str/cexpr': [stdplus_dep, gtest_main_dep],
William A. Kennington III0e844d52022-12-06 23:57:32 -080023 'str/conv': [stdplus_dep, gmock_dep, gtest_main_dep],
William A. Kennington III521475e2022-12-12 16:51:44 -080024 'str/maps': [stdplus_dep, gmock_dep, gtest_main_dep],
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070025 'util/cexec': [stdplus_dep, gtest_main_dep],
William A. Kennington IIIdb1bdbc2023-01-09 16:02:13 -080026 'variant': [stdplus_dep, gtest_main_dep],
William A. Kennington IIIf2ddf512022-09-20 15:36:44 -070027 'zstring': [stdplus_dep, gtest_main_dep],
William A. Kennington III61a81bc2022-09-19 17:46:49 -070028 'zstring_view': [stdplus_dep, gtest_main_dep],
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070029}
William A. Kennington IIId7acddd2022-07-13 16:41:11 -070030
William A. Kennington III5a528022021-04-28 12:52:43 -070031if has_dl
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070032 gtests += {
33 'dl': [stdplus_dl_dep, gtest_main_dep],
34 }
William A. Kennington III5a528022021-04-28 12:52:43 -070035elif build_tests.enabled()
36 error('Not testing libdl feature')
37else
38 warning('Not testing libdl feature')
39endif
40
William A. Kennington IIIeac9d472020-08-03 13:57:14 -070041if has_fd
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070042 gtests += {
43 'fd/dupable': [stdplus_fd_dep],
44 'fd/managed': [stdplus_fd_dep],
William A. Kennington IIIaa4fcfc2022-08-23 16:35:10 -070045 'fd/fmt': [stdplus_fd_dep, stdplus_dep, gtest_main_dep],
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070046 '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 III93ae9702023-12-22 16:41:17 -080051 'fd/ops': [stdplus_fd_dep, stdplus_dep, gmock_dep, gtest_main_dep],
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070052 }
53 if has_gtest
54 gtests += {
William A. Kennington IIIaa4fcfc2022-08-23 16:35:10 -070055 'fd/atomic': [stdplus_fd_dep, stdplus_gtest_dep, gtest_main_dep],
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070056 }
57 elif build_tests.enabled()
William A. Kennington IIIaa4fcfc2022-08-23 16:35:10 -070058 error('Not testing fd/atomic feature')
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070059 else
William A. Kennington IIIaa4fcfc2022-08-23 16:35:10 -070060 warning('Not testing fd/atomic feature')
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070061 endif
William A. Kennington III45754242021-04-28 12:48:31 -070062elif build_tests.enabled()
63 error('Not testing file descriptor feature')
William A. Kennington IIIeac9d472020-08-03 13:57:14 -070064else
65 warning('Not testing file descriptor feature')
66endif
67
William A. Kennington III5c20da22021-06-18 16:44:55 -070068if has_io_uring
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070069 gtests += {
70 'io_uring': [stdplus_io_uring_dep, stdplus_dep, gmock_dep, gtest_main_dep],
71 }
William A. Kennington III5c20da22021-06-18 16:44:55 -070072elif build_tests.enabled()
73 error('Not testing io_uring feature')
74else
75 warning('Not testing io_uring feature')
76endif
77
William A. Kennington III953de362022-07-13 17:32:55 -070078if has_gtest
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070079 gtests += {
80 'gtest/tmp': [stdplus_gtest_dep, gtest_main_dep],
81 }
William A. Kennington III953de362022-07-13 17:32:55 -070082elif build_tests.enabled()
83 error('Not testing gtest lib feature')
84else
85 warning('Not testing gtest lib feature')
86endif
87
William A. Kennington IIIb4674602022-08-24 14:54:37 -070088add_test_setup(
89 'stdplus',
90 exe_wrapper: run_with_tmp,
91 env: {'TMPTMPL': 'stdplus-test.XXXXXXXXXX'},
92 is_default: true)
93
94add_test_setup(
95 'valgrind',
96 exe_wrapper: [run_with_tmp, 'valgrind'],
97 env: {'TMPTMPL': 'stdplus-test.XXXXXXXXXX'})
98
William A. Kennington III953de362022-07-13 17:32:55 -070099if gtest_dep.found() and gmock_dep.found()
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -0700100 foreach t, deps : gtests
William A. Kennington III953de362022-07-13 17:32:55 -0700101 test(
102 t,
William A. Kennington IIIb4674602022-08-24 14:54:37 -0700103 executable(
William A. Kennington III953de362022-07-13 17:32:55 -0700104 t.underscorify(), t + '.cpp',
105 build_by_default: false,
106 implicit_include_directories: false,
William A. Kennington III1cad7d72023-06-06 13:50:01 -0700107 cpp_args: '-Wno-missing-braces',
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -0700108 dependencies: deps))
William A. Kennington III83af3fa2021-01-31 15:22:54 -0800109 endforeach
110endif