The Meson Build System
http://mesonbuild.com/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.1 KiB
39 lines
1.1 KiB
7 years ago
|
project('180 escape', 'c')
|
||
|
|
||
|
gen = generator(find_program('file.py'), arguments:['@INPUT@', 'erd\u0151', '@OUTPUT@'], output: '@BASENAME@')
|
||
|
|
||
|
gen_file = gen.process('file.c.in')
|
||
|
|
||
|
find_file_list = run_command(find_program('find.py'))
|
||
|
assert(find_file_list.returncode() == 0, 'Didn\'t find any files.')
|
||
|
|
||
|
# Strings should support both octal \ooo and hex \xhh encodings
|
||
|
|
||
|
found_files_oct = []
|
||
|
foreach l : find_file_list.stdout().strip('\0').split('\000')
|
||
|
found_files_oct += [files(l)]
|
||
|
endforeach
|
||
|
|
||
|
test('first', executable('first', found_files_oct + [gen_file]))
|
||
|
|
||
|
found_files_hex = []
|
||
|
foreach l : find_file_list.stdout().strip('\x00').split('\x00')
|
||
|
found_files_hex += [files(l)]
|
||
|
endforeach
|
||
|
|
||
|
test('second', executable('second', found_files_hex + [gen_file]))
|
||
6 years ago
|
|
||
|
# Unrecognized and malformed escape sequences are literal
|
||
|
|
||
|
malformed = [
|
||
|
[ '\c', 'c' ],
|
||
|
[ '\Uabcdefghi', 'Uabcdefghi'],
|
||
|
[ '\u123 ', 'u123 '],
|
||
|
[ '\xqr', 'xqr'],
|
||
|
]
|
||
|
|
||
|
foreach m : malformed
|
||
|
assert(m[0].endswith(m[1]), 'bad escape sequence had unexpected end')
|
||
|
assert(m[0].startswith('\\'), 'bad escape sequence had unexpected start')
|
||
|
endforeach
|