liboqs/tests/run_astyle.sh
Michael Baentsch a8dad8d305
adding memory leak testing (#1234)
* adding memory leak testing for x86_64 on ubuntu

* document test exclusion of Classic-McEliece-8192128
2022-07-01 09:09:03 +02:00

22 lines
716 B
Bash
Executable File

#!/bin/bash
# SPDX-License-Identifier: MIT
rv=0
# check style of non-external code:
find src tests -name '*.[ch]' | grep -v '/external/' | grep -v 'kem/.*/.*/.*' | grep -v 'sig/.*/.*/.*' | xargs astyle --dry-run --options=.astylerc | grep Format
if [ $? -ne 1 ]; then
echo "Error: Some files need reformatting. Check output above."
rv=-1
fi
# check _all_ source files for CRLF line endings (except in repos directory):
find . \( -type d -name repos -prune \) -o -name '*.[chS]' -exec file "{}" ";" | grep CRLF
if [ $? -ne 1 ]; then
echo "Error: Files found with non-UNIX line endings."
echo "To fix, consider running \"find src tests -name '*.[chS]' | xargs sed -i 's/\r//' \"."
rv=-1
fi
exit $rv