diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-08-27 15:51:41 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-09-08 22:08:34 +0000 |
commit | 93cc178cfedb281ad05f988850d601e600361d9a (patch) | |
tree | 095e8bb867b153fe363dd49b10ab512e2ac58ccf /.travis | |
parent | ab4477d9315d6d62a449920a32099503c656f43a (diff) |
Add tool to find directly recursive calls in toxcore.
We should avoid recursion, as it makes reasoning about stack growth
harder. This tool shows (currently) 4 (non-tail) recursive functions, at
least 2 of which are easy to fix.
Diffstat (limited to '.travis')
-rwxr-xr-x | .travis/bazel-linux | 7 | ||||
-rwxr-xr-x | .travis/cmake-linux | 7 |
2 files changed, 11 insertions, 3 deletions
diff --git a/.travis/bazel-linux b/.travis/bazel-linux index b157437d..5594ff8c 100755 --- a/.travis/bazel-linux +++ b/.travis/bazel-linux | |||
@@ -16,9 +16,10 @@ travis_install() { | |||
16 | } | 16 | } |
17 | 17 | ||
18 | travis_script() { | 18 | travis_script() { |
19 | bazel test //c-toxcore:license_test | 19 | bazel test \ |
20 | bazel test //c-toxcore:readme_test | 20 | //c-toxcore:license_test \ |
21 | bazel test //c-toxcore:yamllint_test | 21 | //c-toxcore:readme_test \ |
22 | //c-toxcore:yamllint_test | ||
22 | 23 | ||
23 | # TODO(iphydf): Make tests have a chance to succeed. | 24 | # TODO(iphydf): Make tests have a chance to succeed. |
24 | # Run the tests, but if they fail, at least we should be able to build. | 25 | # Run the tests, but if they fail, at least we should be able to build. |
diff --git a/.travis/cmake-linux b/.travis/cmake-linux index fe5de10a..541eb014 100755 --- a/.travis/cmake-linux +++ b/.travis/cmake-linux | |||
@@ -53,8 +53,15 @@ travis_install() { | |||
53 | } | 53 | } |
54 | 54 | ||
55 | run_static_analysis() { | 55 | run_static_analysis() { |
56 | pylint -E other/analysis/check_recursion | ||
57 | |||
56 | export CPPFLAGS="-isystem $CACHEDIR/include" | 58 | export CPPFLAGS="-isystem $CACHEDIR/include" |
57 | export LDFLAGS="-L $CACHEDIR/lib" | 59 | export LDFLAGS="-L $CACHEDIR/lib" |
60 | cat toxav/*.c toxcore/*.c toxencryptsave/*.c \ | ||
61 | | clang `pkg-config --cflags libsodium opus vpx` \ | ||
62 | -Itoxav -Itoxcore -Itoxencryptsave -S -emit-llvm -xc - -o- \ | ||
63 | | opt -analyze -print-callgraph 2>&1 \ | ||
64 | | other/analysis/check_recursion | ||
58 | other/analysis/run-clang | 65 | other/analysis/run-clang |
59 | other/analysis/run-clang-analyze | 66 | other/analysis/run-clang-analyze |
60 | } | 67 | } |