1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
|
unittest_args = [
'-DCHECK_SUPPORT_TAP=1',
'-DSRCDIR="' + meson.project_source_root() + '"',
'-DBUILDDIR="' + meson.current_build_dir() + '"',
'-DTOP_BUILDDIR="' + meson.project_build_root() + '"',
'-DLT_OBJDIR="."',
]
testlog_sources = files('testlog.c')
testlog = executable('testlog',
testlog_sources,
c_args : unittest_args,
include_directories : configuration_inc,
link_with : mmlib,
)
test('testlog', testlog)
testerrno_sources = files('testerrno.c')
testerrno = executable('testerrno',
testerrno_sources,
c_args : unittest_args,
include_directories : configuration_inc,
link_with : mmlib,
)
test('testerrno', testerrno)
testprofile_sources = files('testprofile.c')
testprofile = executable('testprofile',
testprofile_sources,
c_args : unittest_args,
include_directories : configuration_inc,
link_with : mmlib,
)
test('testprofile', testprofile)
child_proc_sources = files('child-proc.c')
executable('child-proc',
child_proc_sources,
c_args : unittest_args,
include_directories : configuration_inc,
link_with : mmlib,
)
tests_child_proc_files = files('tests-child-proc.c',
'tests-child-proc.h',
'process-testlib.c',
'process-testlib.h',
'threaddata-manipulation.h',
'threaddata-manipulation.c',
'socket-testlib.h',
'socket-testlib.c',
'ipc-api-tests-exported.c',
'ipc-api-tests-exported.h',
)
executable('tests-child-proc',
tests_child_proc_files,
c_args : unittest_args + ['-DMMLOG_MODULE_NAME="tests_child_proc"'],
export_dynamic : true,
include_directories : configuration_inc,
link_with : mmlib,
)
perflock_sources = files('perflock.c')
perflock = executable('perflock',
perflock_sources,
include_directories : configuration_inc,
c_args : unittest_args,
link_with : mmlib,
dependencies: [libcheck],
)
dynlib_test_sources = files('dynlib-api.h', 'dynlib-test.c')
shared_module('dynlib-test',
dynlib_test_sources,
name_prefix : '', # do not prefix with 'lib'
include_directories : configuration_inc,
c_args : unittest_args,
)
test_internals_sources = files(
'internals-testcases.h',
'log-internals.c',
'testinternals.c',
)
if host_machine.system() == 'windows'
test_internals_sources += files('startup-win32-internals.c')
endif
testinternals = executable('testinternals',
test_internals_sources,
c_args : unittest_args + cflags,
include_directories : configuration_inc,
link_with : mmlib_static,
dependencies: libcheck,
)
test('internal tests', testinternals,
env: ['CK_VERBOSITY=silent'],
protocol: 'tap',
)
# create the binary and shared library for the rename and unlink tests
subdir('handmaid')
testapi_sources = files(
'alloc-api-tests.c',
'api-testcases.h',
'argparse-api-tests.c',
'dirtests.c',
'dlfcn-api-tests.c',
'file_advanced_tests.c',
'file-api-tests.c',
'ipc-api-tests.c',
'ipc-api-tests-exported.c',
'ipc-api-tests-exported.h',
'process-api-tests.c',
'shm-api-tests.c',
'socket-api-tests.c',
'socket-testlib.c',
'socket-testlib.h',
'testapi.c',
'tests-child-proc.h',
'tests-run-func.c',
'thread-api-tests.c',
'threaddata-manipulation.c',
'threaddata-manipulation.h',
'time-api-tests.c',
'utils-api-tests.c'
)
libmath = cc.find_library('m', required : true)
testapi_deps = [libcheck, libmath]
if host_machine.system() == 'windows'
testapi_deps += libws2_32
endif
testapi = executable('testapi',
testapi_sources,
c_args : unittest_args + cflags,
include_directories : configuration_inc,
link_with : mmlib,
dependencies: testapi_deps,
)
# increase timeout to 5 min (300s) for windows
# as long as *all* the API tests are part of the same program, it makes
# sense anyway
test('unit api tests', testapi,
env: ['CK_VERBOSITY=silent'],
timeout : 300,
protocol: 'tap',
)
|