~mmach/netext73/lz4

« back to all changes in this revision

Viewing changes to contrib/meson/meson/tests/meson.build

  • Committer: mmach
  • Date: 2022-11-09 18:52:10 UTC
  • Revision ID: netbit73@gmail.com-20221109185210-w358idlhh0phq688
1.9.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# #############################################################################
2
 
# Copyright (c) 2018-present    lzutao <taolzu(at)gmail.com>
 
2
# Copyright (c) 2018-present        lzutao <taolzu(at)gmail.com>
 
3
# Copyright (c) 2022-present        Tristan Partin <tristan(at)partin.io>
3
4
# All rights reserved.
4
5
#
5
6
# This source code is licensed under both the BSD-style license (found in the
7
8
# in the COPYING file in the root directory of this source tree).
8
9
# #############################################################################
9
10
 
10
 
lz4_root_dir = '../../../..'
11
 
programs_dir_inc = include_directories(join_paths(lz4_root_dir, 'programs'))
12
 
lib_dir_inc = include_directories(join_paths(lz4_root_dir, 'lib'))
13
 
 
14
 
# =============================================================================
15
 
# Test flags
16
 
# =============================================================================
17
 
 
18
 
TEST_FILES   = join_paths(meson.current_source_dir(), lz4_root_dir, 'tests/COPYING')
19
 
FUZZER_TIME  = '-T90s'
20
 
NB_LOOPS     = '-i1'
21
 
 
22
 
# =============================================================================
23
 
# Executables
24
 
# =============================================================================
25
 
 
26
 
fullbench_sources = [join_paths(lz4_root_dir, 'tests/fullbench.c')]
27
 
fullbench = executable('fullbench',
28
 
  fullbench_sources,
29
 
  include_directories: programs_dir_inc,
30
 
  dependencies: liblz4_dep,
31
 
  install: false)
32
 
 
33
 
fuzzer_sources = [join_paths(lz4_root_dir, 'tests/fuzzer.c')]
34
 
fuzzer = executable('fuzzer',
35
 
  fuzzer_sources,
36
 
  c_args: ['-D_DEFAULT_SOURCE', '-D_BSD_SOURCE'], # since glibc 2.19
37
 
  include_directories: programs_dir_inc,
38
 
  dependencies: liblz4_dep,
39
 
  install: false)
40
 
 
41
 
frametest_sources = [join_paths(lz4_root_dir, 'tests/frametest.c')]
42
 
frametest = executable('frametest',
43
 
  frametest_sources,
44
 
  include_directories: programs_dir_inc,
45
 
  dependencies: liblz4_dep,
46
 
  install: false)
47
 
 
48
 
roundTripTest_sources = [join_paths(lz4_root_dir, 'tests/roundTripTest.c')]
49
 
roundTripTest = executable('roundTripTest',
50
 
  roundTripTest_sources,
51
 
  dependencies: [ liblz4_dep ],
52
 
  install: false)
53
 
 
54
 
datagen_sources = [join_paths(lz4_root_dir, 'tests/datagencli.c')]
55
 
datagen = executable('datagen',
56
 
  datagen_sources,
57
 
  objects: lz4.extract_objects(join_paths(lz4_root_dir, 'programs/datagen.c')),
58
 
  include_directories: lz4_includes,
59
 
  dependencies: [ liblz4_dep ],
60
 
  install: false)
61
 
 
62
 
checkFrame_sources = [join_paths(lz4_root_dir, 'tests/checkFrame.c')]
63
 
checkFrame = executable('checkFrame',
64
 
  checkFrame_sources,
65
 
  include_directories: programs_dir_inc,
66
 
  dependencies: [ liblz4_dep ],
67
 
  install: false)
68
 
 
69
 
checkTag_sources = [join_paths(lz4_root_dir, 'tests/checkTag.c')]
70
 
checkTag = executable('checkTag',
71
 
  checkTag_sources,
72
 
  include_directories: lib_dir_inc,
73
 
  install: false)
74
 
 
75
 
# =============================================================================
76
 
# Tests (Use "meson test --list" to list all tests)
77
 
# =============================================================================
78
 
 
79
 
# XXX: (Need TEST) These timeouts (in seconds) when running on a HDD should be
80
 
# at least six times bigger than on a SSD
81
 
 
82
 
test('test-fullbench',
83
 
  fullbench,
84
 
  args: ['--no-prompt', NB_LOOPS, TEST_FILES],
85
 
  timeout: 420) # Should enough when running on HDD
86
 
test('test-fuzzer',
87
 
  fuzzer,
88
 
  args: [FUZZER_TIME],
89
 
  timeout: 100)
90
 
test('test-frametest',
91
 
  frametest,
92
 
  args: [FUZZER_TIME],
93
 
  timeout: 100)
 
11
lz4_source_root = '../../../..'
 
12
 
 
13
exes = {
 
14
  'fullbench': {
 
15
    'sources': files(lz4_source_root / 'tests/fullbench.c'),
 
16
    'include_directories': include_directories(lz4_source_root / 'programs'),
 
17
  },
 
18
  'fuzzer': {
 
19
    'sources': files(lz4_source_root / 'tests/fuzzer.c'),
 
20
    'include_directories': include_directories(lz4_source_root / 'programs'),
 
21
  },
 
22
  'frametest': {
 
23
    'sources': files(lz4_source_root / 'tests/frametest.c'),
 
24
    'include_directories': include_directories(lz4_source_root / 'programs'),
 
25
  },
 
26
  'roundTripTest': {
 
27
    'sources': files(lz4_source_root / 'tests/roundTripTest.c'),
 
28
  },
 
29
  'datagen': {
 
30
    'sources': files(lz4_source_root / 'tests/datagencli.c'),
 
31
    'objects': lz4.extract_objects(lz4_source_root / 'programs/datagen.c'),
 
32
    'include_directories': include_directories(lz4_source_root / 'programs'),
 
33
  },
 
34
  'checkFrame': {
 
35
    'sources': files(lz4_source_root / 'tests/checkFrame.c'),
 
36
    'include_directories': include_directories(lz4_source_root / 'programs'),
 
37
  },
 
38
  'checkTag': {
 
39
    'sources': files(lz4_source_root / 'tests/checkTag.c'),
 
40
  },
 
41
}
 
42
 
 
43
foreach e, attrs : exes
 
44
  executable(
 
45
    e,
 
46
    attrs.get('sources'),
 
47
    objects: attrs.get('objects', []),
 
48
    dependencies: [liblz4_internal_dep],
 
49
    include_directories: attrs.get('include_directories', []),
 
50
    install: false
 
51
  )
 
52
endforeach