blob: 452edae9841f75a7f92004cc2e0341c0e75ae41a [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],
6 'raw': [stdplus_dep, gmock_dep, gtest_main_dep],
7 'signal': [stdplus_dep, gtest_main_dep],
8 'util/cexec': [stdplus_dep, gtest_main_dep],
9 'util/string': [stdplus_dep, gtest_main_dep],
10}
William A. Kennington IIId7acddd2022-07-13 16:41:11 -070011
William A. Kennington III5a528022021-04-28 12:52:43 -070012if has_dl
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070013 gtests += {
14 'dl': [stdplus_dl_dep, gtest_main_dep],
15 }
William A. Kennington III5a528022021-04-28 12:52:43 -070016elif build_tests.enabled()
17 error('Not testing libdl feature')
18else
19 warning('Not testing libdl feature')
20endif
21
William A. Kennington IIIeac9d472020-08-03 13:57:14 -070022if has_fd
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070023 gtests += {
24 'fd/dupable': [stdplus_fd_dep],
25 'fd/managed': [stdplus_fd_dep],
William A. Kennington IIIaa4fcfc2022-08-23 16:35:10 -070026 'fd/fmt': [stdplus_fd_dep, stdplus_dep, gtest_main_dep],
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070027 'fd/intf': [stdplus_fd_dep],
28 'fd/impl': [stdplus_fd_dep],
29 'fd/line': [stdplus_fd_dep, stdplus_dep, gmock_dep, gtest_main_dep],
30 'fd/mmap': [stdplus_fd_dep, gtest_main_dep],
31 'fd/mock': [stdplus_fd_dep, gmock_dep, gtest_main_dep],
32 'fd/ops': [stdplus_fd_dep, gtest_main_dep],
33 }
34 if has_gtest
35 gtests += {
William A. Kennington IIIaa4fcfc2022-08-23 16:35:10 -070036 'fd/atomic': [stdplus_fd_dep, stdplus_gtest_dep, gtest_main_dep],
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070037 }
38 elif build_tests.enabled()
William A. Kennington IIIaa4fcfc2022-08-23 16:35:10 -070039 error('Not testing fd/atomic feature')
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070040 else
William A. Kennington IIIaa4fcfc2022-08-23 16:35:10 -070041 warning('Not testing fd/atomic feature')
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070042 endif
William A. Kennington III45754242021-04-28 12:48:31 -070043elif build_tests.enabled()
44 error('Not testing file descriptor feature')
William A. Kennington IIIeac9d472020-08-03 13:57:14 -070045else
46 warning('Not testing file descriptor feature')
47endif
48
William A. Kennington III5c20da22021-06-18 16:44:55 -070049if has_io_uring
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070050 gtests += {
51 'io_uring': [stdplus_io_uring_dep, stdplus_dep, gmock_dep, gtest_main_dep],
52 }
William A. Kennington III5c20da22021-06-18 16:44:55 -070053elif build_tests.enabled()
54 error('Not testing io_uring feature')
55else
56 warning('Not testing io_uring feature')
57endif
58
William A. Kennington III953de362022-07-13 17:32:55 -070059if has_gtest
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070060 gtests += {
61 'gtest/tmp': [stdplus_gtest_dep, gtest_main_dep],
62 }
William A. Kennington III953de362022-07-13 17:32:55 -070063elif build_tests.enabled()
64 error('Not testing gtest lib feature')
65else
66 warning('Not testing gtest lib feature')
67endif
68
William A. Kennington IIIb4674602022-08-24 14:54:37 -070069add_test_setup(
70 'stdplus',
71 exe_wrapper: run_with_tmp,
72 env: {'TMPTMPL': 'stdplus-test.XXXXXXXXXX'},
73 is_default: true)
74
75add_test_setup(
76 'valgrind',
77 exe_wrapper: [run_with_tmp, 'valgrind'],
78 env: {'TMPTMPL': 'stdplus-test.XXXXXXXXXX'})
79
William A. Kennington III953de362022-07-13 17:32:55 -070080if gtest_dep.found() and gmock_dep.found()
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070081 foreach t, deps : gtests
William A. Kennington III953de362022-07-13 17:32:55 -070082 test(
83 t,
William A. Kennington IIIb4674602022-08-24 14:54:37 -070084 executable(
William A. Kennington III953de362022-07-13 17:32:55 -070085 t.underscorify(), t + '.cpp',
86 build_by_default: false,
87 implicit_include_directories: false,
William A. Kennington IIIef2c0b72022-08-24 15:12:53 -070088 dependencies: deps))
William A. Kennington III83af3fa2021-01-31 15:22:54 -080089 endforeach
90endif