| 1 |
##===- meson.build - Rules for building clang-extract *- meson ----------*-===## |
| 2 |
## |
| 3 |
## This project is licensed under the Apache License v2.0 with LLVM Exceptions. |
| 4 |
## See https://llvm.org/LICENSE.txt for license information. |
| 5 |
## SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 |
## |
| 7 |
##===----------------------------------------------------------------------===## |
| 8 |
## |
| 9 |
### \file |
| 10 |
### Rules and scripts for building libcextract. |
| 11 |
## |
| 12 |
##===----------------------------------------------------------------------===## |
| 13 |
# |
| 14 |
# Author: Giuliano Belinassi |
| 15 |
|
| 16 |
runtest = find_program('lib/runtest.py') |
| 17 |
ordinary_test_dirs = [ 'small/', 'includes/', 'ccp/', 'decompress', 'linux', 'lateext' ] |
| 18 |
|
| 19 |
returncode_to_bool = [ true, false ] |
| 20 |
|
| 21 |
foreach test_dir : ordinary_test_dirs |
| 22 |
subdir(test_dir) # Only here for meson to build the directory. |
| 23 |
test_files = run_command('find', test_dir, '-name', '*.c', '-o', '-name', '*.cpp', |
| 24 |
check: true).stdout().strip().split('\n') |
| 25 |
|
| 26 |
foreach file : test_files |
| 27 |
test_path = meson.current_source_dir() + '/' + file |
| 28 |
outp_path = meson.current_build_dir() + '/' + file + '.log' |
| 29 |
should_fail = returncode_to_bool[ |
| 30 |
run_command('grep', '-nwI', '{ *dg-xfail *}', test_path, check: false).returncode()] |
| 31 |
test(file, runtest, args : [ test_path, '-o', outp_path ], should_fail: should_fail) |
| 32 |
endforeach |
| 33 |
endforeach |
| 34 |
|
| 35 |
# Now the inline tests, which behaves differently. |
| 36 |
subdir('inline') |