From 9b969de641f29c99bfaac70346824b539347c18c Mon Sep 17 00:00:00 2001 From: Sam Dodrill Date: Fri, 20 Feb 2015 00:31:20 -0800 Subject: [PATCH 1/2] testsuite/astyle: Add script to check coding style --- testsuite/astyle/check_style.sh | 64 +++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100755 testsuite/astyle/check_style.sh diff --git a/testsuite/astyle/check_style.sh b/testsuite/astyle/check_style.sh new file mode 100755 index 0000000..12326ab --- /dev/null +++ b/testsuite/astyle/check_style.sh @@ -0,0 +1,64 @@ +#!/bin/bash -e + +cd ../.. + +for file in $(find **/*.c) +do + if [[ $file = "bandb/sqlite3.c" ]] + then + continue + fi + + if [[ $file = "src/lex.yy.c" ]] + then + continue + fi + + if [[ $file = "src/y.tab.c" ]] + then + continue + fi + + if [[ $file = "tools/convertilines.c" ]] + then + continue + fi + + if [[ $file = "tools/convertklines.c" ]] + then + continue + fi + + if [[ $file = "tools/mkpasswd.c" ]] + then + continue + fi + + if [[ $file = "tools/viconf.c" ]] + then + continue + fi + + if [[ $file = "unsupported/make_override_immune.c" ]] + then + continue + fi + + if [[ $file = "unsupported/m_clearchan.c" ]] + then + continue + fi + + if [[ $file = "unsupported/sno_channeljoin.c" ]] + then + continue + fi + + if [[ $(astyle --style=linux --mode=c -n $file 2>&1 | cut -f1 -d' ') = "Unchanged" ]] + then + echo "$file passed coding standards" + else + echo "$file is not at coding standards." + exit 1 + fi +done From 2c0ee6900cd6129563f9dc6a0e8f12aa69574dde Mon Sep 17 00:00:00 2001 From: Sam Dodrill Date: Fri, 20 Feb 2015 00:33:55 -0800 Subject: [PATCH 2/2] Add travis tests for astyle --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 958371f..77d2115 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,5 +5,5 @@ compiler: before-install: - sudo apt-get update install: -- sudo apt-get install build-essential libssl-dev flex bison -script: "./configure && make" +- sudo apt-get install build-essential libssl-dev flex bison astyle +script: "(cd ./testsuite/astyle && ./check_style.sh) ./configure && make"