blob: 9c0580b8e5ea4c29f4a3263ddbcafa1d92e65c54 [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 III8c5f28c2022-12-07 01:21:36 -080011 'numeric/endian': [stdplus_dep, gtest_main_dep],
William A. Kennington IIIcb9ddb62022-11-18 19:50:10 -080012 'pinned': [stdplus_dep, gtest_main_dep],
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070013 'raw': [stdplus_dep, gmock_dep, gtest_main_dep],
14 'signal': [stdplus_dep, gtest_main_dep],
William A. Kennington III60479702022-12-07 02:55:24 -080015 'str/cat': [stdplus_dep, gtest_main_dep],
William A. Kennington III48a470a2022-12-10 17:09:59 -080016 'str/cexpr': [stdplus_dep, gtest_main_dep],
William A. Kennington III521475e2022-12-12 16:51:44 -080017 'str/maps': [stdplus_dep, gmock_dep, gtest_main_dep],
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070018 'util/cexec': [stdplus_dep, gtest_main_dep],
William A. Kennington IIIdb1bdbc2023-01-09 16:02:13 -080019 'variant': [stdplus_dep, gtest_main_dep],
William A. Kennington IIIf2ddf512022-09-20 15:36:44 -070020 'zstring': [stdplus_dep, gtest_main_dep],
William A. Kennington III61a81bc2022-09-19 17:46:49 -070021 'zstring_view': [stdplus_dep, gtest_main_dep],
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070022}
William A. Kennington IIId7acddd2022-07-13 16:41:11 -070023
William A. Kennington III5a528022021-04-28 12:52:43 -070024if has_dl
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070025 gtests += {
26 'dl': [stdplus_dl_dep, gtest_main_dep],
27 }
William A. Kennington III5a528022021-04-28 12:52:43 -070028elif build_tests.enabled()
29 error('Not testing libdl feature')
30else
31 warning('Not testing libdl feature')
32endif
33
William A. Kennington IIIeac9d472020-08-03 13:57:14 -070034if has_fd
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070035 gtests += {
36 'fd/dupable': [stdplus_fd_dep],
37 'fd/managed': [stdplus_fd_dep],
William A. Kennington IIIaa4fcfc2022-08-23 16:35:10 -070038 'fd/fmt': [stdplus_fd_dep, stdplus_dep, gtest_main_dep],
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070039 'fd/intf': [stdplus_fd_dep],
40 'fd/impl': [stdplus_fd_dep],
41 'fd/line': [stdplus_fd_dep, stdplus_dep, gmock_dep, gtest_main_dep],
42 'fd/mmap': [stdplus_fd_dep, gtest_main_dep],
43 'fd/mock': [stdplus_fd_dep, gmock_dep, gtest_main_dep],
44 'fd/ops': [stdplus_fd_dep, gtest_main_dep],
45 }
46 if has_gtest
47 gtests += {
William A. Kennington IIIaa4fcfc2022-08-23 16:35:10 -070048 'fd/atomic': [stdplus_fd_dep, stdplus_gtest_dep, gtest_main_dep],
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070049 }
50 elif build_tests.enabled()
William A. Kennington IIIaa4fcfc2022-08-23 16:35:10 -070051 error('Not testing fd/atomic feature')
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070052 else
William A. Kennington IIIaa4fcfc2022-08-23 16:35:10 -070053 warning('Not testing fd/atomic feature')
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070054 endif
William A. Kennington III45754242021-04-28 12:48:31 -070055elif build_tests.enabled()
56 error('Not testing file descriptor feature')
William A. Kennington IIIeac9d472020-08-03 13:57:14 -070057else
58 warning('Not testing file descriptor feature')
59endif
60
William A. Kennington III5c20da22021-06-18 16:44:55 -070061if has_io_uring
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070062 gtests += {
63 'io_uring': [stdplus_io_uring_dep, stdplus_dep, gmock_dep, gtest_main_dep],
64 }
William A. Kennington III5c20da22021-06-18 16:44:55 -070065elif build_tests.enabled()
66 error('Not testing io_uring feature')
67else
68 warning('Not testing io_uring feature')
69endif
70
William A. Kennington III953de362022-07-13 17:32:55 -070071if has_gtest
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070072 gtests += {
73 'gtest/tmp': [stdplus_gtest_dep, gtest_main_dep],
74 }
William A. Kennington III953de362022-07-13 17:32:55 -070075elif build_tests.enabled()
76 error('Not testing gtest lib feature')
77else
78 warning('Not testing gtest lib feature')
79endif
80
William A. Kennington IIIb4674602022-08-24 14:54:37 -070081add_test_setup(
82 'stdplus',
83 exe_wrapper: run_with_tmp,
84 env: {'TMPTMPL': 'stdplus-test.XXXXXXXXXX'},
85 is_default: true)
86
87add_test_setup(
88 'valgrind',
89 exe_wrapper: [run_with_tmp, 'valgrind'],
90 env: {'TMPTMPL': 'stdplus-test.XXXXXXXXXX'})
91
William A. Kennington III953de362022-07-13 17:32:55 -070092if gtest_dep.found() and gmock_dep.found()
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070093 foreach t, deps : gtests
William A. Kennington III953de362022-07-13 17:32:55 -070094 test(
95 t,
William A. Kennington IIIb4674602022-08-24 14:54:37 -070096 executable(
William A. Kennington III953de362022-07-13 17:32:55 -070097 t.underscorify(), t + '.cpp',
98 build_by_default: false,
99 implicit_include_directories: false,
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -0700100 dependencies: deps))
William A. Kennington III83af3fa2021-01-31 15:22:54 -0800101 endforeach
102endif