mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-13 21:23:34 +08:00
Work on format testing.
This commit is contained in:
+7
-1
@@ -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
@@ -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})
|
||||
|
||||
Executable
+21
@@ -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
|
||||
Reference in New Issue
Block a user