mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Add cmake test for apidsl.
This commit is contained in:
parent
503d198741
commit
7075c3648a
|
@ -223,6 +223,9 @@ target_link_libraries(toxencryptsave toxcore)
|
||||||
#
|
#
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
add_test(format_test
|
||||||
|
${CMAKE_SOURCE_DIR}/other/astyle/format-source "${CMAKE_SOURCE_DIR}")
|
||||||
|
|
||||||
function(auto_test target)
|
function(auto_test target)
|
||||||
if(CHECK_FOUND)
|
if(CHECK_FOUND)
|
||||||
add_executable(auto_${target} auto_tests/${target}.c)
|
add_executable(auto_${target} auto_tests/${target}.c)
|
||||||
|
|
|
@ -1,9 +1,35 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
SOURCE_DIR="$1"
|
||||||
|
|
||||||
|
# Go to the source root.
|
||||||
|
if [ -z "$SOURCE_DIR" ]; then
|
||||||
|
SOURCE_DIR=.
|
||||||
|
fi
|
||||||
|
cd "$SOURCE_DIR"
|
||||||
|
|
||||||
if [ -z "$ASTYLE" ]; then
|
if [ -z "$ASTYLE" ]; then
|
||||||
ASTYLE=astyle
|
ASTYLE=astyle
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -f ../apidsl/_build/apigen.native ]; then
|
||||||
|
APIDSL=../apidsl/_build/apigen.native
|
||||||
|
else
|
||||||
|
APIDSL=apidsl_curl
|
||||||
|
fi
|
||||||
|
|
||||||
|
apidsl_curl() {
|
||||||
|
curl -X POST --data-binary @"$1" https://apidsl.herokuapp.com/apidsl
|
||||||
|
}
|
||||||
|
|
||||||
|
# Check if toxcore.h and toxav.h match apidsl tox.in.h and toxav.in.h.
|
||||||
|
$APIDSL other/apidsl/tox.in.h > toxcore/tox.h
|
||||||
|
$APIDSL other/apidsl/toxav.in.h > toxav/toxav.h
|
||||||
|
|
||||||
SOURCES=`find . -name "*.[ch]" -and -not -name "*.in.*" -and -not -wholename "*crypto_pwhash*" -and -not -wholename "./super_donators/*"`
|
SOURCES=`find . -name "*.[ch]" -and -not -name "*.in.*" -and -not -wholename "*crypto_pwhash*" -and -not -wholename "./super_donators/*"`
|
||||||
|
|
||||||
$ASTYLE -n --options=other/astyle/astylerc $SOURCES
|
$ASTYLE -n --options=other/astyle/astylerc $SOURCES
|
||||||
|
|
||||||
|
git diff --exit-code
|
||||||
|
|
|
@ -3,9 +3,6 @@
|
||||||
set -e -u -x
|
set -e -u -x
|
||||||
. other/travis/env-$ENV.sh
|
. other/travis/env-$ENV.sh
|
||||||
|
|
||||||
# Check if toxcore.h and toxav.h match apidsl tox.in.h and toxav.in.h.
|
|
||||||
../apidsl/_build/apigen.native other/apidsl/tox.in.h > toxcore/tox.h
|
|
||||||
../apidsl/_build/apigen.native other/apidsl/toxav.in.h > toxav/toxav.h
|
|
||||||
# Check if the code is formatted according to the astyle configuration.
|
# Check if the code is formatted according to the astyle configuration.
|
||||||
other/astyle/format-source
|
other/astyle/format-source
|
||||||
git diff --exit-code
|
git diff --exit-code
|
||||||
|
|
Loading…
Reference in New Issue
Block a user