10 - ubuntu-toolchain-r-test
17 - sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-suggests --no-install-recommends devscripts equivs xdotool
19 - sudo DEBIAN_FRONTEND=noninteractive mk-build-deps --install --remove --tool 'apt-get -yq --no-install-suggests --no-install-recommends' debian/control
20 # Install as many dependencies as possible via apt because cpanm is not very reliable/easy to debug.
21 - sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-suggests --no-install-recommends libanyevent-perl libanyevent-i3-perl libextutils-pkgconfig-perl xcb-proto cpanminus xvfb xserver-xephyr xauth libinline-perl libxml-simple-perl libmouse-perl libmousex-nativetraits-perl libextutils-depends-perl perl-modules libtest-deep-perl libtest-exception-perl libxml-parser-perl libtest-simple-perl libtest-fatal-perl libdata-dump-perl libtest-differences-perl libxml-tokeparser-perl libtest-use-ok-perl libipc-run-perl libxcb-xtest0-dev
22 - sudo /bin/sh -c 'cpanm -n -v X11::XCB || true'
23 - sudo /bin/sh -c 'cpanm -n -v AnyEvent::I3 || true'
25 - if [ -a .git/shallow ]; then git fetch --unshallow; fi
26 - if [ "$CC" = "clang" ]; then export CC="clang-3.5"; fi
27 - if [ "$CC" = "gcc" ]; then export CC="gcc-5"; fi
28 - CFLAGS="-Wformat -Wformat-security -Wextra -Wno-unused-parameter -Werror" make -j ASAN=1
29 - (cd testcases && xvfb-run ./complete-run.pl --parallel=1 || (cat latest/complete-run.log; false))
30 - clang-format-3.5 -i $(find . -name "*.[ch]" | tr '\n' ' ') && git diff --exit-code || (echo 'Code was not formatted using clang-format!'; false)
32 funcs='malloc|calloc|realloc|strdup|strndup|asprintf|write'
33 cstring='"([^"\\]|\\.)*"'
34 cchar="'[^\\\\]'|'\\\\.[^']*'"
35 regex="^([^'\"]|${cstring}|${cchar})*\<(${funcs})\>"
37 while IFS= read -r file; do
38 if { cpp -w -fpreprocessed "$file" || exit "$?"; } | grep -E -- "$regex"; then
39 echo "^ $file calls a function that has a safe counterpart."
43 $(find -name '*.c' -not -name safewrappers.c -not -name strndup.c)
45 if [ "$detected" -ne 0 ]; then
47 echo "Calls of functions that have safe counterparts were detected."