Patched in formatting function
This commit is contained in:
parent
a6d9e582be
commit
1f652b7c37
17
otto.sh
17
otto.sh
|
@ -10,6 +10,22 @@ TEMPLATE_FILES=".template_files"
|
||||||
MODULE_DIR="${TEMPLATE_FILES}/modules"
|
MODULE_DIR="${TEMPLATE_FILES}/modules"
|
||||||
|
|
||||||
|
|
||||||
|
format_source_code () {
|
||||||
|
#Get a list of all C files
|
||||||
|
source_c_files=$(find ./src -name '*.c')
|
||||||
|
for f in $source_c_files; do
|
||||||
|
clang-format -i -style=file $f
|
||||||
|
done
|
||||||
|
|
||||||
|
#Get a list of all H files
|
||||||
|
source_h_files=$(find ./src -name '*.h')
|
||||||
|
for f in $source_h_files; do
|
||||||
|
clang-format -i -style=file $f
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "Applying Formating standard!"
|
||||||
|
}
|
||||||
|
|
||||||
add_compile_commands () {
|
add_compile_commands () {
|
||||||
if [ -f ./compile_commands.json ]; then
|
if [ -f ./compile_commands.json ]; then
|
||||||
echo "compile_commands.json already exists!\n"
|
echo "compile_commands.json already exists!\n"
|
||||||
|
@ -253,6 +269,7 @@ flash_avr () {
|
||||||
}
|
}
|
||||||
|
|
||||||
run_c_tests () {
|
run_c_tests () {
|
||||||
|
format_source_code
|
||||||
clear_cmake_cache
|
clear_cmake_cache
|
||||||
cmake -DUNIT_TESTING=ON -DCMAKE_VERBOSE_MAKEFILE=${CMAKE_VERBOSE} ../
|
cmake -DUNIT_TESTING=ON -DCMAKE_VERBOSE_MAKEFILE=${CMAKE_VERBOSE} ../
|
||||||
make AllTests
|
make AllTests
|
||||||
|
|
Loading…
Reference in New Issue