forked from TypesettingTools/Aegisub
-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathmeson.build
More file actions
92 lines (81 loc) · 2.03 KB
/
Copy pathmeson.build
File metadata and controls
92 lines (81 loc) · 2.03 KB
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
all_test_deps = []
all_test_dep_libs = []
all_test_sources = []
gtest_dep = dependency('gtest', main: true, required: false)
gmock_dep = dependency('gmock', required: false)
if not gtest_dep.found() or not gmock_dep.found()
gtest_proj = subproject('gtest')
gtest_dep = gtest_proj.get_variable('gtest_dep')
gmock_dep = gtest_proj.get_variable('gmock_dep')
endif
all_test_deps += [
gtest_dep,
gmock_dep,
iconv_dep,
boost_dep
]
all_test_dep_libs += [
libaegisub
]
all_test_sources += [
'support/main.cpp',
'support/util.cpp',
'tests/access.cpp',
'tests/audio.cpp',
'tests/cajun.cpp',
'tests/calltip_provider.cpp',
'tests/character_count.cpp',
'tests/color.cpp',
'tests/dialogue_lexer.cpp',
'tests/format.cpp',
'tests/fs.cpp',
'tests/hotkey.cpp',
'tests/iconv.cpp',
'tests/ifind.cpp',
'tests/karaoke_matcher.cpp',
'tests/keyframe.cpp',
'tests/line_iterator.cpp',
'tests/line_wrap.cpp',
'tests/mru.cpp',
'tests/option.cpp',
'tests/path.cpp',
'tests/signals.cpp',
'tests/split.cpp',
'tests/syntax_highlight.cpp',
'tests/thesaurus.cpp',
'tests/time.cpp',
'tests/type_name.cpp',
'tests/util.cpp',
'tests/uuencode.cpp',
'tests/vfr.cpp',
'tests/word_split.cpp'
]
test_inc = include_directories('support')
# force UTF8 for MSVC
if host_machine.system() == 'windows'
extra_args = ['/utf-8']
else
extra_args = []
endif
runner = executable(
'gtest-main',
all_test_sources,
include_directories : [test_inc, libaegisub_inc, deps_inc],
dependencies : all_test_deps,
cpp_args : extra_args,
link_with : all_test_dep_libs,
)
test('gtest main', runner)
# setup test env
if host_machine.system() == 'windows'
setup_sh = find_program('setup.bat')
else
setup_sh = find_program('setup.sh')
endif
test_data_des = meson.project_build_root()
custom_target('setup-test-data',
input: runner,
output: 'applied_test_setup',
command: [setup_sh, test_data_des],
build_by_default: true
)