blob: 01104c56614b975fd3e5f6794c5f5cd4611bc907 [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],
4 'handle/copyable': [stdplus_dep, gtest_main_dep],
5 'handle/managed': [stdplus_dep, gtest_main_dep],
William A. Kennington III403cda22022-12-12 15:52:35 -08006 'hash': [stdplus_dep, gtest_main_dep],
William A. Kennington III85149ee2023-01-03 18:15:47 -08007 'hash/array': [stdplus_dep, gtest_main_dep],
William A. Kennington IIIb07a2eb2023-01-03 18:14:40 -08008 'hash/tuple': [stdplus_dep, gtest_main_dep],
William A. Kennington IIIb25086a2023-01-09 18:53:29 -08009 'net/addr/ether': [stdplus_dep, gtest_main_dep],
William A. Kennington III9330c872023-01-04 15:41:53 -080010 'net/addr/ip': [stdplus_dep, gtest_main_dep],
William A. Kennington III14dd4eb2023-01-12 10:51:12 -080011 'net/addr/subnet': [stdplus_dep, gtest_main_dep],
William A. Kennington III8c5f28c2022-12-07 01:21:36 -080012 'numeric/endian': [stdplus_dep, gtest_main_dep],
William A. Kennington IIIcb9ddb62022-11-18 19:50:10 -080013 'pinned': [stdplus_dep, gtest_main_dep],
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070014 'raw': [stdplus_dep, gmock_dep, gtest_main_dep],
15 'signal': [stdplus_dep, gtest_main_dep],
William A. Kennington III60479702022-12-07 02:55:24 -080016 'str/cat': [stdplus_dep, gtest_main_dep],
William A. Kennington III48a470a2022-12-10 17:09:59 -080017 'str/cexpr': [stdplus_dep, gtest_main_dep],
William A. Kennington III521475e2022-12-12 16:51:44 -080018 'str/maps': [stdplus_dep, gmock_dep, gtest_main_dep],
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070019 'util/cexec': [stdplus_dep, gtest_main_dep],
William A. Kennington IIIdb1bdbc2023-01-09 16:02:13 -080020 'variant': [stdplus_dep, gtest_main_dep],
William A. Kennington IIIf2ddf512022-09-20 15:36:44 -070021 'zstring': [stdplus_dep, gtest_main_dep],
William A. Kennington III61a81bc2022-09-19 17:46:49 -070022 'zstring_view': [stdplus_dep, gtest_main_dep],
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070023}
William A. Kennington IIId7acddd2022-07-13 16:41:11 -070024
William A. Kennington III5a528022021-04-28 12:52:43 -070025if has_dl
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070026 gtests += {
27 'dl': [stdplus_dl_dep, gtest_main_dep],
28 }
William A. Kennington III5a528022021-04-28 12:52:43 -070029elif build_tests.enabled()
30 error('Not testing libdl feature')
31else
32 warning('Not testing libdl feature')
33endif
34
William A. Kennington IIIeac9d472020-08-03 13:57:14 -070035if has_fd
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070036 gtests += {
37 'fd/dupable': [stdplus_fd_dep],
38 'fd/managed': [stdplus_fd_dep],
William A. Kennington IIIaa4fcfc2022-08-23 16:35:10 -070039 'fd/fmt': [stdplus_fd_dep, stdplus_dep, gtest_main_dep],
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070040 'fd/intf': [stdplus_fd_dep],
41 'fd/impl': [stdplus_fd_dep],
42 'fd/line': [stdplus_fd_dep, stdplus_dep, gmock_dep, gtest_main_dep],
43 'fd/mmap': [stdplus_fd_dep, gtest_main_dep],
44 'fd/mock': [stdplus_fd_dep, gmock_dep, gtest_main_dep],
45 'fd/ops': [stdplus_fd_dep, gtest_main_dep],
46 }
47 if has_gtest
48 gtests += {
William A. Kennington IIIaa4fcfc2022-08-23 16:35:10 -070049 'fd/atomic': [stdplus_fd_dep, stdplus_gtest_dep, gtest_main_dep],
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070050 }
51 elif build_tests.enabled()
William A. Kennington IIIaa4fcfc2022-08-23 16:35:10 -070052 error('Not testing fd/atomic feature')
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070053 else
William A. Kennington IIIaa4fcfc2022-08-23 16:35:10 -070054 warning('Not testing fd/atomic feature')
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070055 endif
William A. Kennington III45754242021-04-28 12:48:31 -070056elif build_tests.enabled()
57 error('Not testing file descriptor feature')
William A. Kennington IIIeac9d472020-08-03 13:57:14 -070058else
59 warning('Not testing file descriptor feature')
60endif
61
William A. Kennington III5c20da22021-06-18 16:44:55 -070062if has_io_uring
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070063 gtests += {
64 'io_uring': [stdplus_io_uring_dep, stdplus_dep, gmock_dep, gtest_main_dep],
65 }
William A. Kennington III5c20da22021-06-18 16:44:55 -070066elif build_tests.enabled()
67 error('Not testing io_uring feature')
68else
69 warning('Not testing io_uring feature')
70endif
71
William A. Kennington III953de362022-07-13 17:32:55 -070072if has_gtest
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070073 gtests += {
74 'gtest/tmp': [stdplus_gtest_dep, gtest_main_dep],
75 }
William A. Kennington III953de362022-07-13 17:32:55 -070076elif build_tests.enabled()
77 error('Not testing gtest lib feature')
78else
79 warning('Not testing gtest lib feature')
80endif
81
William A. Kennington IIIb4674602022-08-24 14:54:37 -070082add_test_setup(
83 'stdplus',
84 exe_wrapper: run_with_tmp,
85 env: {'TMPTMPL': 'stdplus-test.XXXXXXXXXX'},
86 is_default: true)
87
88add_test_setup(
89 'valgrind',
90 exe_wrapper: [run_with_tmp, 'valgrind'],
91 env: {'TMPTMPL': 'stdplus-test.XXXXXXXXXX'})
92
William A. Kennington III953de362022-07-13 17:32:55 -070093if gtest_dep.found() and gmock_dep.found()
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070094 foreach t, deps : gtests
William A. Kennington III953de362022-07-13 17:32:55 -070095 test(
96 t,
William A. Kennington IIIb4674602022-08-24 14:54:37 -070097 executable(
William A. Kennington III953de362022-07-13 17:32:55 -070098 t.underscorify(), t + '.cpp',
99 build_by_default: false,
100 implicit_include_directories: false,
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -0700101 dependencies: deps))
William A. Kennington III83af3fa2021-01-31 15:22:54 -0800102 endforeach
103endif