Work on format testing.

This commit is contained in:
jgoppert
2015-11-04 22:48:13 -05:00
parent eddc55827a
commit b818774f6a
3 changed files with 36 additions and 6 deletions
+7 -1
View File
@@ -1,6 +1,12 @@
language: c
script:
- mkdir -p build && cd build && cmake -DCOVERALLS=ON -DCOVERALLS_UPLOAD=ON -DCMAKE_BUILD_TYPE=Debug .. && make && ctest -V && make coveralls
- mkdir -p build
- cd build
- cmake -DCOVERALLS=ON -DCOVERALLS_UPLOAD=ON -DCMAKE_BUILD_TYPE=Debug ..
- make
- make check_format
- ctest -V
- make coveralls
env:
global:
- export COVERALLS_SERVICE_NAME=travis-ci
+8 -5
View File
@@ -22,7 +22,6 @@ set(CMAKE_CXX_FLAGS
-Wall
-Weffc++
-Werror
-std=c++11
#-Wfatal-errors
)
@@ -65,12 +64,16 @@ endif()
add_subdirectory(test)
add_custom_target(format
COMMAND astyle --recursive
${CMAKE_SOURCE_DIR}/matrix/*.*pp
${CMAKE_SOURCE_DIR}/test/*.*pp
COMMAND scripts/format.sh 1
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
VERBATIM
)
)
add_custom_target(check_format
COMMAND scripts/format.sh
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
VERBATIM
)
set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
+21
View File
@@ -0,0 +1,21 @@
#!/bin/bash
echo pwd:$PWD
format=$1
format_wildcards="""
./matrix/*.*pp
./test/*.*pp
"""
if [[ $format ]]
then
echo formatting
astyle ${format_wildcards}
else
echo checking format
astyle --dry-run ${format_wildcards} | grep Formatted
if [[ $? -eq 0 ]]
then
echo need to format
exit 1
fi
fi