-
Notifications
You must be signed in to change notification settings - Fork 8
/
meson.build
100 lines (85 loc) · 2.89 KB
/
meson.build
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
project('jasmine-gjs', version: '3.99.1', license: 'MIT',
meson_version: '>= 0.58.0')
gjs_dep = dependency('gjs-1.0', required: false)
if gjs_dep.found()
gjs = find_program(gjs_dep.get_variable('gjs_console'))
else
gjs = find_program('gjs', 'gjs-console')
endif
pkglibexecdir = join_paths(get_option('libexecdir'), meson.project_name())
pkgdatadir = join_paths(get_option('datadir'), meson.project_name())
jasmine_mod = meson.project_name()
uninstalled_pkglibexecdir = meson.current_build_dir()
uninstalled_pkgdatadir = join_paths(meson.current_source_dir(), 'src')
uninstalled_jasmine_mod = 'lib'
# Executables
config = configuration_data()
if meson.is_subproject()
config.set('pkgdatadir', uninstalled_pkgdatadir)
config.set('pkglibexecdir', uninstalled_pkglibexecdir)
config.set('jasmine_mod', uninstalled_jasmine_mod)
else
config.set('pkgdatadir', join_paths(get_option('prefix'), pkgdatadir))
config.set('pkglibexecdir', join_paths(get_option('prefix'), pkglibexecdir))
config.set('jasmine_mod', jasmine_mod)
endif
config.set('PACKAGE_VERSION', meson.project_version())
jasmine = configure_file(configuration: config, input: 'bin/jasmine.in',
output: 'jasmine', install: not meson.is_subproject(), install_dir: 'bin')
configure_file(configuration: config,
input: 'bin/jasmine-runner.in', output: 'jasmine-runner',
install: not meson.is_subproject(),
install_dir: pkglibexecdir)
meson.override_find_program('jasmine', jasmine)
# Source code and Jasmine library
if not meson.is_subproject()
install_data(
'lib/jasmine.js',
'src/command.js',
'src/config.js',
'src/consoleReporter.js',
'src/jasmineBoot.js',
'src/junitReporter.js',
'src/options.js',
'src/tapReporter.js',
'src/timer.js',
'src/utils.js',
'src/verboseReporter.js',
'src/xmlWriter.js',
install_dir: pkgdatadir,
)
endif
# Documentation
if not meson.is_subproject()
install_data('jasmine.man', rename: 'jasmine.1',
install_dir: join_paths(get_option('datadir'), 'man', 'man1'))
endif
# Tests
tests = [
'0_your_first_suite',
'custom_matcher',
'commandSpec',
'configSpec',
'consoleReporterSpec',
'defaultReporterSpec',
'importerSpec',
'jasmineBootSpec',
'junitReporterSpec',
'optionsSpec',
'tapReporterSpec',
'timerSpec',
'utilsSpec',
'verboseReporterSpec',
'xmlWriterSpec',
]
if not meson.is_subproject()
test_env = environment()
test_env.set('TEST_PKGDATADIR', uninstalled_pkgdatadir)
test_env.set('TEST_PKGLIBEXECDIR', uninstalled_pkglibexecdir)
test_env.set('TEST_JASMINE_MOD', uninstalled_jasmine_mod)
foreach t : tests
test_file = files('test/@[email protected]'.format(t))
test(t, gjs, args: ['-m', jasmine, test_file, '--module', '--tap', '--no-config'],
env: test_env, protocol: 'tap')
endforeach
endif