blob: 16e1e7765e4fc6ae63f2dbc115d99818aa5c8ba7 [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 IIIcb9ddb62022-11-18 19:50:10 -08006 'pinned': [stdplus_dep, gtest_main_dep],
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -07007 'raw': [stdplus_dep, gmock_dep, gtest_main_dep],
8 'signal': [stdplus_dep, gtest_main_dep],
9 'util/cexec': [stdplus_dep, gtest_main_dep],
10 'util/string': [stdplus_dep, gtest_main_dep],
William A. Kennington IIIf2ddf512022-09-20 15:36:44 -070011 'zstring': [stdplus_dep, gtest_main_dep],
William A. Kennington III61a81bc2022-09-19 17:46:49 -070012 'zstring_view': [stdplus_dep, gtest_main_dep],
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070013}
William A. Kennington IIId7acddd2022-07-13 16:41:11 -070014
William A. Kennington III5a528022021-04-28 12:52:43 -070015if has_dl
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070016 gtests += {
17 'dl': [stdplus_dl_dep, gtest_main_dep],
18 }
William A. Kennington III5a528022021-04-28 12:52:43 -070019elif build_tests.enabled()
20 error('Not testing libdl feature')
21else
22 warning('Not testing libdl feature')
23endif
24
William A. Kennington IIIeac9d472020-08-03 13:57:14 -070025if has_fd
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070026 gtests += {
27 'fd/dupable': [stdplus_fd_dep],
28 'fd/managed': [stdplus_fd_dep],
William A. Kennington IIIaa4fcfc2022-08-23 16:35:10 -070029 'fd/fmt': [stdplus_fd_dep, stdplus_dep, gtest_main_dep],
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070030 'fd/intf': [stdplus_fd_dep],
31 'fd/impl': [stdplus_fd_dep],
32 'fd/line': [stdplus_fd_dep, stdplus_dep, gmock_dep, gtest_main_dep],
33 'fd/mmap': [stdplus_fd_dep, gtest_main_dep],
34 'fd/mock': [stdplus_fd_dep, gmock_dep, gtest_main_dep],
35 'fd/ops': [stdplus_fd_dep, gtest_main_dep],
36 }
37 if has_gtest
38 gtests += {
William A. Kennington IIIaa4fcfc2022-08-23 16:35:10 -070039 'fd/atomic': [stdplus_fd_dep, stdplus_gtest_dep, gtest_main_dep],
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070040 }
41 elif build_tests.enabled()
William A. Kennington IIIaa4fcfc2022-08-23 16:35:10 -070042 error('Not testing fd/atomic feature')
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070043 else
William A. Kennington IIIaa4fcfc2022-08-23 16:35:10 -070044 warning('Not testing fd/atomic feature')
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070045 endif
William A. Kennington III45754242021-04-28 12:48:31 -070046elif build_tests.enabled()
47 error('Not testing file descriptor feature')
William A. Kennington IIIeac9d472020-08-03 13:57:14 -070048else
49 warning('Not testing file descriptor feature')
50endif
51
William A. Kennington III5c20da22021-06-18 16:44:55 -070052if has_io_uring
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070053 gtests += {
54 'io_uring': [stdplus_io_uring_dep, stdplus_dep, gmock_dep, gtest_main_dep],
55 }
William A. Kennington III5c20da22021-06-18 16:44:55 -070056elif build_tests.enabled()
57 error('Not testing io_uring feature')
58else
59 warning('Not testing io_uring feature')
60endif
61
William A. Kennington III953de362022-07-13 17:32:55 -070062if has_gtest
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070063 gtests += {
64 'gtest/tmp': [stdplus_gtest_dep, gtest_main_dep],
65 }
William A. Kennington III953de362022-07-13 17:32:55 -070066elif build_tests.enabled()
67 error('Not testing gtest lib feature')
68else
69 warning('Not testing gtest lib feature')
70endif
71
William A. Kennington IIIb4674602022-08-24 14:54:37 -070072add_test_setup(
73 'stdplus',
74 exe_wrapper: run_with_tmp,
75 env: {'TMPTMPL': 'stdplus-test.XXXXXXXXXX'},
76 is_default: true)
77
78add_test_setup(
79 'valgrind',
80 exe_wrapper: [run_with_tmp, 'valgrind'],
81 env: {'TMPTMPL': 'stdplus-test.XXXXXXXXXX'})
82
William A. Kennington III953de362022-07-13 17:32:55 -070083if gtest_dep.found() and gmock_dep.found()
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070084 foreach t, deps : gtests
William A. Kennington III953de362022-07-13 17:32:55 -070085 test(
86 t,
William A. Kennington IIIb4674602022-08-24 14:54:37 -070087 executable(
William A. Kennington III953de362022-07-13 17:32:55 -070088 t.underscorify(), t + '.cpp',
89 build_by_default: false,
90 implicit_include_directories: false,
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070091 dependencies: deps))
William A. Kennington III83af3fa2021-01-31 15:22:54 -080092 endforeach
93endif