mirror of
https://cagebreak.project-repo.co/cagebreak.git
synced 2026-08-22 13:34:18 +02:00
Add test to check clang-format
This commit is contained in:
parent
d9f61d86fb
commit
a222a5a60f
2 changed files with 26 additions and 0 deletions
|
|
@ -310,5 +310,6 @@ message('\n'.join(summary))
|
|||
|
||||
# Test Suite
|
||||
|
||||
test('Clang-format formatting check', find_program('test/clang-format'), args : [ cagebreak_main_file + cagebreak_source_strings + cagebreak_header_strings ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic')
|
||||
test('Arguments', find_program('test/arguments'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic')
|
||||
test('Scan-build static analysis', find_program('test/scan-build'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'release')
|
||||
|
|
|
|||
25
test/clang-format
Normal file
25
test/clang-format
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#! /bin/sh
|
||||
|
||||
readonly declared_deps="${@}"
|
||||
readonly hardcoded_deps="fuzz/execl_override.c fuzz/fuzz-lib.c fuzz/fuzz-lib.h fuzz/fuzz-parse.c"
|
||||
readonly deps="${declared_deps} ${hardcoded_deps}"
|
||||
|
||||
RESULT=0
|
||||
|
||||
set -x
|
||||
|
||||
echo $MESONCURRENTCONFIGDIR
|
||||
|
||||
for file in ${deps}
|
||||
do
|
||||
echo "${file}"
|
||||
if $(clang-format -Werror --dry-run "$MESONCURRENTCONFIGDIR/${file}")
|
||||
then
|
||||
echo " [x] clang-format"
|
||||
else
|
||||
RESULT=1
|
||||
echo " [ ] clang-format"
|
||||
fi
|
||||
done
|
||||
|
||||
exit "${RESULT}"
|
||||
Loading…
Add table
Add a link
Reference in a new issue