Revert the previous change in 250681196f

Make style check fail when astyle fails.
This commit is contained in:
Alex Parent 2016-11-14 16:27:01 -05:00
parent 250681196f
commit 20b1f0809a
4 changed files with 31 additions and 6 deletions

View File

@ -6,6 +6,7 @@ if [[ $(find -E . -name '*.[ch]' -exec grep -H bzero {} \;) ]];
then
tput setaf 1;
echo "Code uses banned functions (bzero).";
tput sgr 0
retvalue=1;
fi;
@ -15,6 +16,7 @@ if [[ $retvalue == 0 ]];
then
tput setaf 2;
echo "Code does not use banned functions.";
tput sgr 0
fi;
exit $retvalue;

View File

@ -4,10 +4,12 @@ if [[ $(nm -g liboqs.a | grep ' T ' | grep -E -v -i ' T [_]?OQS') ]];
then
tput setaf 1;
echo "Code contains the following non-namespaced global symbols; see https://github.com/open-quantum-safe/liboqs/wiki/Coding-conventions for function naming conventions.";
tput sgr 0
nm -g liboqs.a | grep ' T ' | grep -E -v -i ' T [_]?OQS'
exit 1;
else
tput setaf 2;
echo "Code adheres to the project standards.";
tput sgr 0
exit 0;
fi;

View File

@ -1,12 +1,21 @@
#!/bin/bash
if [[ $(make prettyprint | grep Formatted) ]];
then
make prettyprint | grep -q Formatted
STATUS=(${PIPESTATUS[*]})
if [ ${STATUS[1]} == 0 ]; then
tput setaf 1;
echo "Code does not adhere to the project standards. Run \"make prettyprint\".";
tput sgr 0;
exit 1;
elif [ ${STATUS[0]} != 0 ]; then
tput setaf 1;
echo "prettyprint failed.";
tput sgr 0;
exit 1;
else
tput setaf 2;
echo "Code adheres to the project standards.";
tput sgr 0;
exit 0;
fi;

View File

@ -12,7 +12,10 @@ matrix:
- ubuntu-toolchain-r-test
packages:
- gcc-4.8
- astyle
before_install:
- wget http://downloads.sourceforge.net/project/astyle/astyle/astyle%202.05.1/astyle_2.05.1_linux.tar.gz
- tar xzf astyle_2.05.1_linux.tar.gz
- cd astyle/build/gcc && make && export PATH=$(pwd)/bin:$PATH && cd ../../../
- os: linux
compiler: gcc
env: CC_OQS=gcc-4.9
@ -22,7 +25,10 @@ matrix:
- ubuntu-toolchain-r-test
packages:
- gcc-4.9
- astyle
before_install:
- wget http://downloads.sourceforge.net/project/astyle/astyle/astyle%202.05.1/astyle_2.05.1_linux.tar.gz
- tar xzf astyle_2.05.1_linux.tar.gz
- cd astyle/build/gcc && make && export PATH=$(pwd)/bin:$PATH && cd ../../../
- os: linux
compiler: gcc
env: CC_OQS=gcc-5
@ -32,7 +38,10 @@ matrix:
- ubuntu-toolchain-r-test
packages:
- gcc-5
- astyle
before_install:
- wget http://downloads.sourceforge.net/project/astyle/astyle/astyle%202.05.1/astyle_2.05.1_linux.tar.gz
- tar xzf astyle_2.05.1_linux.tar.gz
- cd astyle/build/gcc && make && export PATH=$(pwd)/bin:$PATH && cd ../../../
- os: linux
compiler: gcc
env: CC_OQS=gcc-6 USE_OPENSSL=1
@ -42,8 +51,11 @@ matrix:
- ubuntu-toolchain-r-test
packages:
- gcc-6
- astyle
- libssl-dev
before_install:
- wget http://downloads.sourceforge.net/project/astyle/astyle/astyle%202.05.1/astyle_2.05.1_linux.tar.gz
- tar xzf astyle_2.05.1_linux.tar.gz
- cd astyle/build/gcc && make && export PATH=$(pwd)/bin:$PATH && cd ../../../
- os: osx
compiler: clang
env: CC_OQS=clang AES_NI=0 USE_OPENSSL=1