summaryrefslogtreecommitdiffstats
path: root/contrib/meson/meson/tests/meson.build
blob: 78004758cf200767ee6b59915c92d1fec3b338b7 (plain)
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
# #############################################################################
# Copyright (c) 2018-present    lzutao <taolzu(at)gmail.com>
# All rights reserved.
#
# This source code is licensed under both the BSD-style license (found in the
# LICENSE file in the root directory of this source tree) and the GPLv2 (found
# in the COPYING file in the root directory of this source tree).
# #############################################################################

lz4_root_dir = '../../../..'
programs_dir_inc = include_directories(join_paths(lz4_root_dir, 'programs'))
lib_dir_inc = include_directories(join_paths(lz4_root_dir, 'lib'))

# =============================================================================
# Test flags
# =============================================================================

TEST_FILES   = join_paths(meson.current_source_dir(), lz4_root_dir, 'tests/COPYING')
FUZZER_TIME  = '-T90s'
NB_LOOPS     = '-i1'

# =============================================================================
# Executables
# =============================================================================

fullbench_sources = [join_paths(lz4_root_dir, 'tests/fullbench.c')]
fullbench = executable('fullbench',
  fullbench_sources,
  include_directories: programs_dir_inc,
  dependencies: liblz4_dep,
  install: false)

fuzzer_sources = [join_paths(lz4_root_dir, 'tests/fuzzer.c')]
fuzzer = executable('fuzzer',
  fuzzer_sources,
  c_args: ['-D_DEFAULT_SOURCE', '-D_BSD_SOURCE'], # since glibc 2.19
  include_directories: programs_dir_inc,
  dependencies: liblz4_dep,
  install: false)

frametest_sources = [join_paths(lz4_root_dir, 'tests/frametest.c')]
frametest = executable('frametest',
  frametest_sources,
  include_directories: programs_dir_inc,
  dependencies: liblz4_dep,
  install: false)

roundTripTest_sources = [join_paths(lz4_root_dir, 'tests/roundTripTest.c')]
roundTripTest = executable('roundTripTest',
  roundTripTest_sources,
  dependencies: [ liblz4_dep ],
  install: false)

datagen_sources = [join_paths(lz4_root_dir, 'tests/datagencli.c')]
datagen = executable('datagen',
  datagen_sources,
  objects: lz4.extract_objects(join_paths(lz4_root_dir, 'programs/datagen.c')),
  include_directories: lz4_includes,
  dependencies: [ liblz4_dep ],
  install: false)

checkFrame_sources = [join_paths(lz4_root_dir, 'tests/checkFrame.c')]
checkFrame = executable('checkFrame',
  checkFrame_sources,
  include_directories: programs_dir_inc,
  dependencies: [ liblz4_dep ],
  install: false)

checkTag_sources = [join_paths(lz4_root_dir, 'tests/checkTag.c')]
checkTag = executable('checkTag',
  checkTag_sources,
  include_directories: lib_dir_inc,
  install: false)

# =============================================================================
# Tests (Use "meson test --list" to list all tests)
# =============================================================================

# XXX: (Need TEST) These timeouts (in seconds) when running on a HDD should be
# at least six times bigger than on a SSD

test('test-fullbench',
  fullbench,
  args: ['--no-prompt', NB_LOOPS, TEST_FILES],
  timeout: 420) # Should enough when running on HDD
test('test-fuzzer',
  fuzzer,
  args: [FUZZER_TIME],
  timeout: 100)
test('test-frametest',
  frametest,
  args: [FUZZER_TIME],
  timeout: 100)