-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
105 lines (98 loc) · 1.76 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
101
102
103
104
105
project('lsp', 'c')
includes = include_directories('include')
### Library ###
lib_sources = [
'src/builtins.c',
'src/env.c',
'src/eval.c',
'src/reader.c',
'src/vm.c',
]
lib = both_libraries(
'lsp', lib_sources,
include_directories : includes,
install : true,
)
### Interpreter ###
executable(
'lsp', 'main.c',
include_directories : includes,
link_with : lib,
install : true,
)
### Tests ###
test_includes = include_directories('include', 'tests')
test_suites = {
'cons': [
'car',
'cdr',
'int_is_not_cons',
'is_cons_pops',
'null_is_not_cons',
'nulls',
'overflow_1',
'overflow_2',
'push',
'set_car',
'set_cdr',
],
'reverse': [
'null',
'pair',
'triple',
],
'reader': [
'empty',
'int_single_digit',
'int_multiple_digit',
'empty_list',
'single_element_list',
'multi_element_list',
'nested_list',
'list_of_nils',
'string',
'string_escapes',
'dotted_pair',
'dotted_list',
'dotted_prefix',
'dotted_suffix',
],
'env': [
'push_empty',
'push_scope',
'define',
'lookup',
'lookup_older',
'lookup_outer',
'lookup_shadowed',
'set',
],
'eval': [
'int',
'symbol',
'if_true',
'if_false',
'add',
'quote_int',
'quote_lambda',
'define_in_empty',
'define_in_nested',
'set',
'lambda',
'add_lambda',
'lambda_body',
'begin',
],
}
foreach suite, tests : test_suites
foreach test_name : tests
test_exe = executable(
'test_' + suite + '_' + test_name,
'tests/' + suite + '/test_' + test_name + '.c',
include_directories : test_includes,
link_with : lib,
install : false,
)
test(suite + '_' + test_name, test_exe)
endforeach
endforeach