summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2020-05-06 00:15:09 +0100
committeriphydf <iphydf@users.noreply.github.com>2020-05-08 01:31:24 +0100
commit3d601fe32066619f50297cb52131d1bbf5e6862e (patch)
tree5729965696d1cfca2eb9b2975411389e1fde0d9f
parent8f4400b9b4a63dd5674ea6e7cf15486e90a01174 (diff)
style: Run restyled on Travis and Circle CI scripts.
-rwxr-xr-x.circleci/cmake-asan30
-rwxr-xr-x.circleci/cmake-tsan30
-rwxr-xr-x.travis/autotools-linux22
-rw-r--r--.travis/cmake-freebsd-env.sh13
-rwxr-xr-x.travis/cmake-freebsd-stage147
-rwxr-xr-x.travis/cmake-freebsd-stage24
-rwxr-xr-x.travis/cmake-osx10
-rwxr-xr-x.travis/cmake-win322
-rwxr-xr-x.travis/cmake-win642
-rw-r--r--.travis/cmake-windows.sh16
-rw-r--r--.travis/flags-clang.sh2
-rw-r--r--.travis/flags-gcc.sh2
-rw-r--r--.travis/flags.sh17
-rwxr-xr-x.travis/tox-bootstrapd-docker20
-rwxr-xr-x.travis/upload-coverage8
15 files changed, 116 insertions, 109 deletions
diff --git a/.circleci/cmake-asan b/.circleci/cmake-asan
index cc1434b1..deabfa39 100755
--- a/.circleci/cmake-asan
+++ b/.circleci/cmake-asan
@@ -1,4 +1,4 @@
1#!/bin/sh 1#!/bin/bash
2 2
3set -eu 3set -eu
4 4
@@ -9,23 +9,23 @@ add_flag -Werror
9add_flag -fdiagnostics-color=always 9add_flag -fdiagnostics-color=always
10add_flag -fno-omit-frame-pointer 10add_flag -fno-omit-frame-pointer
11add_flag -fsanitize=address,undefined 11add_flag -fsanitize=address,undefined
12cmake -B_build -H. -GNinja \ 12cmake -B_build -H. -GNinja \
13 -DCMAKE_C_FLAGS="$C_FLAGS" \ 13 -DCMAKE_C_FLAGS="$C_FLAGS" \
14 -DCMAKE_CXX_FLAGS="$CXX_FLAGS" \ 14 -DCMAKE_CXX_FLAGS="$CXX_FLAGS" \
15 -DCMAKE_EXE_LINKER_FLAGS="$LD_FLAGS" \ 15 -DCMAKE_EXE_LINKER_FLAGS="$LD_FLAGS" \
16 -DCMAKE_SHARED_LINKER_FLAGS="$LD_FLAGS" \ 16 -DCMAKE_SHARED_LINKER_FLAGS="$LD_FLAGS" \
17 -DCMAKE_INSTALL_PREFIX:PATH="$PWD/_install" \ 17 -DCMAKE_INSTALL_PREFIX:PATH="$PWD/_install" \
18 -DMIN_LOGGER_LEVEL=TRACE \ 18 -DMIN_LOGGER_LEVEL=TRACE \
19 -DMUST_BUILD_TOXAV=ON \ 19 -DMUST_BUILD_TOXAV=ON \
20 -DNON_HERMETIC_TESTS=ON \ 20 -DNON_HERMETIC_TESTS=ON \
21 -DSTRICT_ABI=ON \ 21 -DSTRICT_ABI=ON \
22 -DTEST_TIMEOUT_SECONDS=120 \ 22 -DTEST_TIMEOUT_SECONDS=120 \
23 -DUSE_IPV6=OFF \ 23 -DUSE_IPV6=OFF \
24 -DAUTOTEST=ON 24 -DAUTOTEST=ON
25 25
26cd _build 26cd _build
27 27
28ninja install -j$(nproc) 28ninja install -j"$(nproc)"
29 29
30export ASAN_OPTIONS="detect_invalid_pointer_pairs=1" 30export ASAN_OPTIONS="detect_invalid_pointer_pairs=1"
31export ASAN_OPTIONS="$ASAN_OPTIONS,detect_stack_use_after_return=1" 31export ASAN_OPTIONS="$ASAN_OPTIONS,detect_stack_use_after_return=1"
@@ -33,4 +33,4 @@ export ASAN_OPTIONS="$ASAN_OPTIONS,strict_init_order=1"
33export ASAN_OPTIONS="$ASAN_OPTIONS,strict_string_checks=1" 33export ASAN_OPTIONS="$ASAN_OPTIONS,strict_string_checks=1"
34export ASAN_OPTIONS="$ASAN_OPTIONS,symbolize=1" 34export ASAN_OPTIONS="$ASAN_OPTIONS,symbolize=1"
35ctest -j50 --output-on-failure || 35ctest -j50 --output-on-failure ||
36ctest -j50 --output-on-failure --rerun-failed 36 ctest -j50 --output-on-failure --rerun-failed
diff --git a/.circleci/cmake-tsan b/.circleci/cmake-tsan
index b42e8f18..b55597b9 100755
--- a/.circleci/cmake-tsan
+++ b/.circleci/cmake-tsan
@@ -1,4 +1,4 @@
1#!/bin/sh 1#!/bin/bash
2 2
3set -eu 3set -eu
4 4
@@ -9,26 +9,26 @@ add_flag -Werror
9add_flag -fdiagnostics-color=always 9add_flag -fdiagnostics-color=always
10add_flag -fno-omit-frame-pointer 10add_flag -fno-omit-frame-pointer
11add_flag -fsanitize=thread 11add_flag -fsanitize=thread
12cmake -B_build -H. -GNinja \ 12cmake -B_build -H. -GNinja \
13 -DCMAKE_C_FLAGS="$C_FLAGS" \ 13 -DCMAKE_C_FLAGS="$C_FLAGS" \
14 -DCMAKE_CXX_FLAGS="$CXX_FLAGS" \ 14 -DCMAKE_CXX_FLAGS="$CXX_FLAGS" \
15 -DCMAKE_EXE_LINKER_FLAGS="$LD_FLAGS" \ 15 -DCMAKE_EXE_LINKER_FLAGS="$LD_FLAGS" \
16 -DCMAKE_SHARED_LINKER_FLAGS="$LD_FLAGS" \ 16 -DCMAKE_SHARED_LINKER_FLAGS="$LD_FLAGS" \
17 -DCMAKE_INSTALL_PREFIX:PATH="$PWD/_install" \ 17 -DCMAKE_INSTALL_PREFIX:PATH="$PWD/_install" \
18 -DMIN_LOGGER_LEVEL=TRACE \ 18 -DMIN_LOGGER_LEVEL=TRACE \
19 -DMUST_BUILD_TOXAV=ON \ 19 -DMUST_BUILD_TOXAV=ON \
20 -DNON_HERMETIC_TESTS=ON \ 20 -DNON_HERMETIC_TESTS=ON \
21 -DSTRICT_ABI=ON \ 21 -DSTRICT_ABI=ON \
22 -DTEST_TIMEOUT_SECONDS=120 \ 22 -DTEST_TIMEOUT_SECONDS=120 \
23 -DUSE_IPV6=OFF \ 23 -DUSE_IPV6=OFF \
24 -DAUTOTEST=ON 24 -DAUTOTEST=ON
25 25
26cd _build 26cd _build
27 27
28ninja install -j$(nproc) 28ninja install -j"$(nproc)"
29 29
30export TSAN_OPTIONS="halt_on_error=1" 30export TSAN_OPTIONS="halt_on_error=1"
31export TSAN_OPTIONS="$TSAN_OPTIONS,second_deadlock_stack=1" 31export TSAN_OPTIONS="$TSAN_OPTIONS,second_deadlock_stack=1"
32export TSAN_OPTIONS="$TSAN_OPTIONS,symbolize=1" 32export TSAN_OPTIONS="$TSAN_OPTIONS,symbolize=1"
33ctest -j50 --output-on-failure || 33ctest -j50 --output-on-failure ||
34ctest -j50 --output-on-failure --rerun-failed 34 ctest -j50 --output-on-failure --rerun-failed
diff --git a/.travis/autotools-linux b/.travis/autotools-linux
index 96c110ab..ffadcad8 100755
--- a/.travis/autotools-linux
+++ b/.travis/autotools-linux
@@ -1,22 +1,24 @@
1#!/bin/sh 1#!/bin/bash
2 2
3ACTION="$1" 3ACTION="$1"
4 4
5set -eu 5set -eu
6 6
7CACHEDIR="$HOME/cache" 7CACHEDIR="$HOME/cache"
8NPROC=`nproc` 8NPROC=$(nproc)
9 9
10travis_install() { 10travis_install() {
11 # Install vanilla NaCl only. 11 # Install vanilla NaCl only.
12 [ -f "$CACHEDIR/lib/amd64/libnacl.a" ] || { 12 [ -f "$CACHEDIR/lib/amd64/libnacl.a" ] || {
13 curl https://hyperelliptic.org/nacl/nacl-20110221.tar.bz2 | tar jx 13 curl https://hyperelliptic.org/nacl/nacl-20110221.tar.bz2 | tar jx
14 cd nacl-20110221 # pushd 14 cd nacl-20110221 # pushd
15 "./do" 15 "./do"
16 # "make install" 16 # "make install"
17 mkdir -p "$CACHEDIR/include"; mv build/*/include/* "$CACHEDIR/include" 17 mkdir -p "$CACHEDIR/include"
18 mkdir -p "$CACHEDIR/lib" ; mv build/*/lib/* "$CACHEDIR/lib" 18 mv build/*/include/* "$CACHEDIR/include"
19 cd - # popd 19 mkdir -p "$CACHEDIR/lib"
20 mv build/*/lib/* "$CACHEDIR/lib"
21 cd - # popd
20 } 22 }
21} 23}
22 24
@@ -38,11 +40,11 @@ travis_script() {
38 40
39 autoreconf -fi 41 autoreconf -fi
40 mkdir -p _build 42 mkdir -p _build
41 cd _build # pushd 43 cd _build # pushd
42 ../configure $CONFIG_FLAGS || (cat config.log && false) 44 ../configure "${CONFIG_FLAGS[@]}" || (cat config.log && false)
43 make "-j$NPROC" -k CFLAGS="$C_FLAGS" LDFLAGS="$LD_FLAGS" 45 make "-j$NPROC" -k CFLAGS="$C_FLAGS" LDFLAGS="$LD_FLAGS"
44 make -j50 -k distcheck DISTCHECK_CONFIGURE_FLAGS="$CONFIG_FLAGS" || (cat tox-*/_build/build/test-suite.log && false) 46 make -j50 -k distcheck DISTCHECK_CONFIGURE_FLAGS="${CONFIG_FLAGS[*]}" || (cat tox-*/_build/build/test-suite.log && false)
45 cd - # popd 47 cd - # popd
46} 48}
47 49
48if [ "-z" "$ACTION" ]; then 50if [ "-z" "$ACTION" ]; then
diff --git a/.travis/cmake-freebsd-env.sh b/.travis/cmake-freebsd-env.sh
index 7d698940..96bf2d49 100644
--- a/.travis/cmake-freebsd-env.sh
+++ b/.travis/cmake-freebsd-env.sh
@@ -1,4 +1,4 @@
1#!/bin/sh 1#!/bin/bash
2 2
3# Common variables and functions 3# Common variables and functions
4 4
@@ -8,19 +8,19 @@ SCREEN_SESSION=freebsd
8SSH_PORT=10022 8SSH_PORT=10022
9 9
10FREEBSD_VERSION="12.1" 10FREEBSD_VERSION="12.1"
11IMAGE_NAME=FreeBSD-${FREEBSD_VERSION}-RELEASE-amd64.raw 11IMAGE_NAME=FreeBSD-$FREEBSD_VERSION-RELEASE-amd64.raw
12# https://download.freebsd.org/ftp/releases/VM-IMAGES/12.1-RELEASE/amd64/Latest/ 12# https://download.freebsd.org/ftp/releases/VM-IMAGES/12.1-RELEASE/amd64/Latest/
13IMAGE_SHA512="a65da6260f5f894fc86fbe1f27dad7800906da7cffaa5077f82682ab74b6dd46c4ce87158c14b726d74ca3c6d611bea3bb336164da3f1cb990550310b110da22" 13IMAGE_SHA512="a65da6260f5f894fc86fbe1f27dad7800906da7cffaa5077f82682ab74b6dd46c4ce87158c14b726d74ca3c6d611bea3bb336164da3f1cb990550310b110da22"
14 14
15RUN() { 15RUN() {
16 ssh -t -o ConnectionAttempts=120 -o ConnectTimeout=2 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@localhost -p $SSH_PORT "$@" 16 ssh -t -o ConnectionAttempts=120 -o ConnectTimeout=2 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@localhost -p "$SSH_PORT" "$@"
17} 17}
18 18
19start_vm() { 19start_vm() {
20 screen -d -m qemu-system-x86_64 -curses -m 2048 -smp $NPROC -net user,hostfwd=tcp::${SSH_PORT}-:22 -net nic "$IMAGE_NAME" 20 screen -d -m qemu-system-x86_64 -curses -m 2048 -smp "$NPROC" -net user,hostfwd=tcp::"$SSH_PORT"-:22 -net nic "$IMAGE_NAME"
21 21
22 # Wait for ssh to start listening on the port 22 # Wait for ssh to start listening on the port
23 while ! echo "exit" | nc localhost ${SSH_PORT} | grep 'OpenSSH'; do 23 while ! echo "exit" | nc localhost "$SSH_PORT" | grep 'OpenSSH'; do
24 sleep 5 24 sleep 5
25 done 25 done
26 26
@@ -29,8 +29,7 @@ start_vm() {
29 RUN last 29 RUN last
30} 30}
31 31
32stop_vm() 32stop_vm() {
33{
34 # Turn it off 33 # Turn it off
35 # We use this contraption because for some reason `shutdown -h now` and 34 # We use this contraption because for some reason `shutdown -h now` and
36 # `poweroff` result in FreeBSD not shutting down on Travis (they work on my 35 # `poweroff` result in FreeBSD not shutting down on Travis (they work on my
diff --git a/.travis/cmake-freebsd-stage1 b/.travis/cmake-freebsd-stage1
index 6a88ed44..29667e82 100755
--- a/.travis/cmake-freebsd-stage1
+++ b/.travis/cmake-freebsd-stage1
@@ -1,4 +1,4 @@
1#!/bin/sh 1#!/bin/bash
2 2
3# Download and initial setup of the FreeBSD VM 3# Download and initial setup of the FreeBSD VM
4 4
@@ -9,7 +9,7 @@ set -eux
9. .travis/cmake-freebsd-env.sh 9. .travis/cmake-freebsd-env.sh
10 10
11travis_install() { 11travis_install() {
12 git tag -l --sort=version:refname > GIT_TAGS 12 git tag -l --sort=version:refname >GIT_TAGS
13 13
14 OLD_PWD="$PWD" 14 OLD_PWD="$PWD"
15 15
@@ -19,9 +19,9 @@ travis_install() {
19 # === Get the VM image, set it up and cache === 19 # === Get the VM image, set it up and cache ===
20 20
21 # Create image if it's not cached, or if this build script has changed, or a new toxcore tag was pushed 21 # Create image if it's not cached, or if this build script has changed, or a new toxcore tag was pushed
22 sha256sum "$OLD_PWD/.travis/cmake-freebsd-env.sh" > /tmp/sha 22 sha256sum "$OLD_PWD/.travis/cmake-freebsd-env.sh" >/tmp/sha
23 sha256sum "$OLD_PWD/.travis/cmake-freebsd-stage1" >> /tmp/sha 23 sha256sum "$OLD_PWD/.travis/cmake-freebsd-stage1" >>/tmp/sha
24 sha256sum "$OLD_PWD/.travis/cmake-freebsd-stage1.expect" >> /tmp/sha 24 sha256sum "$OLD_PWD/.travis/cmake-freebsd-stage1.expect" >>/tmp/sha
25 if [ ! -f "./$IMAGE_NAME.tgz" ] || [ ! -f ./cmake-freebsd-stage1-all.sha256 ] || [ "$(cat cmake-freebsd-stage1-all.sha256)" != "$(cat /tmp/sha)" ] || ! diff -u ./GIT_TAGS "$OLD_PWD/GIT_TAGS"; then 25 if [ ! -f "./$IMAGE_NAME.tgz" ] || [ ! -f ./cmake-freebsd-stage1-all.sha256 ] || [ "$(cat cmake-freebsd-stage1-all.sha256)" != "$(cat /tmp/sha)" ] || ! diff -u ./GIT_TAGS "$OLD_PWD/GIT_TAGS"; then
26 rm -rf ./* 26 rm -rf ./*
27 27
@@ -42,8 +42,8 @@ travis_install() {
42 DL_MIRROR_11=14 42 DL_MIRROR_11=14
43 43
44 # There are 11 mirrors 44 # There are 11 mirrors
45 DL_MIRROR_RANDOM=`expr $(date +%s) % 11 + 1` 45 DL_MIRROR_RANDOM=$(expr "$(date +%s)" % 11 + 1)
46 DL_URL="ftp://ftp$(eval echo \$DL_MIRROR_$DL_MIRROR_RANDOM).us.freebsd.org/pub/FreeBSD/releases/VM-IMAGES/${FREEBSD_VERSION}-RELEASE/amd64/Latest/${IMAGE_NAME}.xz" 46 DL_URL="ftp://ftp$(eval echo \$DL_MIRROR_"$DL_MIRROR_RANDOM").us.freebsd.org/pub/FreeBSD/releases/VM-IMAGES/$FREEBSD_VERSION-RELEASE/amd64/Latest/$IMAGE_NAME.xz"
47 47
48 # Make sure there are no partial downloads from the previous loop iterations 48 # Make sure there are no partial downloads from the previous loop iterations
49 rm -rf ./* 49 rm -rf ./*
@@ -51,7 +51,7 @@ travis_install() {
51 wget --tries 1 "$DL_URL" && break 51 wget --tries 1 "$DL_URL" && break
52 done 52 done
53 53
54 if ! ( echo "$IMAGE_SHA512 $IMAGE_NAME.xz" | sha512sum -c --status - ) ; then 54 if ! (echo "$IMAGE_SHA512 $IMAGE_NAME.xz" | sha512sum -c --status -); then
55 echo "Error: sha512 of $IMAGE_NAME.xz doesn't match the known one" 55 echo "Error: sha512 of $IMAGE_NAME.xz doesn't match the known one"
56 exit 1 56 exit 1
57 fi 57 fi
@@ -81,18 +81,19 @@ travis_install() {
81 RUN chsh -s /usr/local/bin/bash root 81 RUN chsh -s /usr/local/bin/bash root
82 82
83 # Install required toxcore dependencies 83 # Install required toxcore dependencies
84 RUN PAGER=cat ASSUME_ALWAYS_YES=YES pkg install git \ 84 RUN PAGER=cat ASSUME_ALWAYS_YES=YES pkg install \
85 opus \ 85 git \
86 libconfig \ 86 opus \
87 libvpx \ 87 libconfig \
88 libsodium \ 88 libvpx \
89 gmake \ 89 libsodium \
90 cmake \ 90 gmake \
91 pkgconf \ 91 cmake \
92 portaudio \ 92 pkgconf \
93 libsndfile \ 93 portaudio \
94 texinfo \ 94 libsndfile \
95 autotools 95 texinfo \
96 autotools
96 97
97 # === Cache the VM image === 98 # === Cache the VM image ===
98 99
@@ -103,9 +104,9 @@ travis_install() {
103 rm "$IMAGE_NAME" 104 rm "$IMAGE_NAME"
104 105
105 cp "$OLD_PWD/GIT_TAGS" . 106 cp "$OLD_PWD/GIT_TAGS" .
106 sha256sum "$OLD_PWD/.travis/cmake-freebsd-env.sh" > cmake-freebsd-stage1-all.sha256 107 sha256sum "$OLD_PWD/.travis/cmake-freebsd-env.sh" >cmake-freebsd-stage1-all.sha256
107 sha256sum "$OLD_PWD/.travis/cmake-freebsd-stage1" >> cmake-freebsd-stage1-all.sha256 108 sha256sum "$OLD_PWD/.travis/cmake-freebsd-stage1" >>cmake-freebsd-stage1-all.sha256
108 sha256sum "$OLD_PWD/.travis/cmake-freebsd-stage1.expect" >> cmake-freebsd-stage1-all.sha256 109 sha256sum "$OLD_PWD/.travis/cmake-freebsd-stage1.expect" >>cmake-freebsd-stage1-all.sha256
109 ls -lh 110 ls -lh
110 fi 111 fi
111 112
diff --git a/.travis/cmake-freebsd-stage2 b/.travis/cmake-freebsd-stage2
index 98090ba1..6db74542 100755
--- a/.travis/cmake-freebsd-stage2
+++ b/.travis/cmake-freebsd-stage2
@@ -1,4 +1,4 @@
1#!/bin/sh 1#!/bin/bash
2 2
3# Toxcore building 3# Toxcore building
4 4
@@ -35,7 +35,7 @@ travis_install() {
35 cd "$OLD_PWD" 35 cd "$OLD_PWD"
36 36
37 # Copy over toxcore code from Travis to qemu 37 # Copy over toxcore code from Travis to qemu
38 scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -P $SSH_PORT -r ./* root@localhost:~ 38 scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -P "$SSH_PORT" -r ./* root@localhost:~
39 39
40 RUN ls -lh 40 RUN ls -lh
41} 41}
diff --git a/.travis/cmake-osx b/.travis/cmake-osx
index cb12301d..b6ee8430 100755
--- a/.travis/cmake-osx
+++ b/.travis/cmake-osx
@@ -1,11 +1,11 @@
1#!/bin/sh 1#!/bin/bash
2 2
3ACTION="$1" 3ACTION="$1"
4 4
5set -eu 5set -eu
6 6
7CACHEDIR="$HOME/cache" 7CACHEDIR="$HOME/cache"
8NPROC=`sysctl -n hw.physicalcpu` 8NPROC=$(sysctl -n hw.physicalcpu)
9 9
10travis_install() { 10travis_install() {
11 # Workaround for bug in Homebrew where it only finds an old Ruby version. 11 # Workaround for bug in Homebrew where it only finds an old Ruby version.
@@ -35,11 +35,11 @@ travis_script() {
35 -DUSE_IPV6=OFF \ 35 -DUSE_IPV6=OFF \
36 -DAUTOTEST=ON 36 -DAUTOTEST=ON
37 37
38 cd _build # pushd 38 cd _build # pushd
39 make "-j$NPROC" -k install 39 make "-j$NPROC" -k install
40 make "-j$NPROC" test ARGS="-j50" || \ 40 make "-j$NPROC" test ARGS="-j50" ||
41 make "-j$NPROC" test ARGS="-j50 --rerun-failed" CTEST_OUTPUT_ON_FAILURE=1 41 make "-j$NPROC" test ARGS="-j50 --rerun-failed" CTEST_OUTPUT_ON_FAILURE=1
42 cd - # popd 42 cd - # popd
43} 43}
44 44
45if [ "-z" "$ACTION" ]; then 45if [ "-z" "$ACTION" ]; then
diff --git a/.travis/cmake-win32 b/.travis/cmake-win32
index e4be36f0..eea88d05 100755
--- a/.travis/cmake-win32
+++ b/.travis/cmake-win32
@@ -1,4 +1,4 @@
1#!/bin/sh 1#!/bin/bash
2 2
3i686=true 3i686=true
4x86_64=false 4x86_64=false
diff --git a/.travis/cmake-win64 b/.travis/cmake-win64
index f961a00b..2b71df90 100755
--- a/.travis/cmake-win64
+++ b/.travis/cmake-win64
@@ -1,4 +1,4 @@
1#!/bin/sh 1#!/bin/bash
2 2
3i686=false 3i686=false
4x86_64=true 4x86_64=true
diff --git a/.travis/cmake-windows.sh b/.travis/cmake-windows.sh
index 85d47e1b..69114471 100644
--- a/.travis/cmake-windows.sh
+++ b/.travis/cmake-windows.sh
@@ -1,20 +1,20 @@
1#!/bin/sh 1#!/bin/bash
2 2
3ACTION="$1" 3ACTION="$1"
4 4
5set -eu 5set -eu
6 6
7CACHEDIR="$HOME/cache" 7CACHEDIR="$HOME/cache"
8NPROC=`nproc` 8NPROC=$(nproc)
9 9
10travis_install() { 10travis_install() {
11 cd other/docker/windows 11 cd other/docker/windows
12 12
13 docker build \ 13 docker build \
14 --build-arg SUPPORT_ARCH_i686=$i686 \ 14 --build-arg SUPPORT_ARCH_i686="$i686" \
15 --build-arg SUPPORT_ARCH_x86_64=$x86_64 \ 15 --build-arg SUPPORT_ARCH_x86_64="$x86_64" \
16 --build-arg SUPPORT_TEST=true \ 16 --build-arg SUPPORT_TEST=true \
17 -t toxcore-$WINDOWS_ARCH \ 17 -t toxcore-"$WINDOWS_ARCH" \
18 . 18 .
19} 19}
20 20
@@ -27,8 +27,8 @@ travis_script() {
27 27
28 docker run \ 28 docker run \
29 -e ALLOW_TEST_FAILURE=true \ 29 -e ALLOW_TEST_FAILURE=true \
30 -e ENABLE_ARCH_i686=$i686 \ 30 -e ENABLE_ARCH_i686="$i686" \
31 -e ENABLE_ARCH_x86_64=$x86_64 \ 31 -e ENABLE_ARCH_x86_64="$x86_64" \
32 -e ENABLE_TEST=true \ 32 -e ENABLE_TEST=true \
33 -e EXTRA_CMAKE_FLAGS="-DBOOTSTRAP_DAEMON=OFF -DMIN_LOGGER_LEVEL=DEBUG -DTEST_TIMEOUT_SECONDS=90 -DAUTOTEST=ON" \ 33 -e EXTRA_CMAKE_FLAGS="-DBOOTSTRAP_DAEMON=OFF -DMIN_LOGGER_LEVEL=DEBUG -DTEST_TIMEOUT_SECONDS=90 -DAUTOTEST=ON" \
34 -e CMAKE_C_FLAGS="$C_FLAGS" \ 34 -e CMAKE_C_FLAGS="$C_FLAGS" \
@@ -38,7 +38,7 @@ travis_script() {
38 -v "$PWD:/toxcore" \ 38 -v "$PWD:/toxcore" \
39 -v "$PWD/result:/prefix" \ 39 -v "$PWD/result:/prefix" \
40 --rm \ 40 --rm \
41 toxcore-$WINDOWS_ARCH 41 toxcore-"$WINDOWS_ARCH"
42} 42}
43 43
44if [ "-z" "$ACTION" ]; then 44if [ "-z" "$ACTION" ]; then
diff --git a/.travis/flags-clang.sh b/.travis/flags-clang.sh
index 1bca35ca..f505698e 100644
--- a/.travis/flags-clang.sh
+++ b/.travis/flags-clang.sh
@@ -1,4 +1,4 @@
1#!/bin/sh 1#!/bin/bash
2 2
3. .travis/flags.sh 3. .travis/flags.sh
4 4
diff --git a/.travis/flags-gcc.sh b/.travis/flags-gcc.sh
index 0d262060..eefc7c26 100644
--- a/.travis/flags-gcc.sh
+++ b/.travis/flags-gcc.sh
@@ -1,4 +1,4 @@
1#!/bin/sh 1#!/bin/bash
2 2
3. .travis/flags.sh 3. .travis/flags.sh
4 4
diff --git a/.travis/flags.sh b/.travis/flags.sh
index a617ec8e..30284d38 100644
--- a/.travis/flags.sh
+++ b/.travis/flags.sh
@@ -1,10 +1,13 @@
1#!/bin/sh 1#!/bin/bash
2 2
3add_config_flag() { CONFIG_FLAGS="$CONFIG_FLAGS $@"; } 3add_config_flag() { CONFIG_FLAGS+=("$@"); }
4add_c_flag() { C_FLAGS="$C_FLAGS $@"; } 4add_c_flag() { C_FLAGS="$C_FLAGS $@"; }
5add_cxx_flag() { CXX_FLAGS="$CXX_FLAGS $@"; } 5add_cxx_flag() { CXX_FLAGS="$CXX_FLAGS $@"; }
6add_ld_flag() { LD_FLAGS="$LD_FLAGS $@"; } 6add_ld_flag() { LD_FLAGS="$LD_FLAGS $@"; }
7add_flag() { add_c_flag "$@"; add_cxx_flag "$@"; } 7add_flag() {
8 add_c_flag "$@"
9 add_cxx_flag "$@"
10}
8 11
9export LD_LIBRARY_PATH="$CACHEDIR/lib" 12export LD_LIBRARY_PATH="$CACHEDIR/lib"
10export PKG_CONFIG_PATH="$CACHEDIR/lib/pkgconfig" 13export PKG_CONFIG_PATH="$CACHEDIR/lib/pkgconfig"
@@ -13,7 +16,7 @@ export PKG_CONFIG_PATH="$CACHEDIR/lib/pkgconfig"
13# and friends here (we unset them below), because they influence config tests 16# and friends here (we unset them below), because they influence config tests
14# such as ./configure and cmake tests. Our warning flags break those tests, so 17# such as ./configure and cmake tests. Our warning flags break those tests, so
15# we can't add them globally here. 18# we can't add them globally here.
16CONFIG_FLAGS="" 19CONFIG_FLAGS=()
17C_FLAGS="" 20C_FLAGS=""
18CXX_FLAGS="" 21CXX_FLAGS=""
19LD_FLAGS="" 22LD_FLAGS=""
diff --git a/.travis/tox-bootstrapd-docker b/.travis/tox-bootstrapd-docker
index bd192f07..e370118d 100755
--- a/.travis/tox-bootstrapd-docker
+++ b/.travis/tox-bootstrapd-docker
@@ -1,8 +1,10 @@
1#!/bin/sh 1#!/bin/bash
2 2
3set -exu 3set -exu
4 4
5tar c $(git ls-files) | docker build -f other/bootstrap_daemon/docker/Dockerfile -t toxchat/bootstrap-node - 5readarray -t FILES <<<"$(git ls-files)"
6
7tar c "${FILES[@]}" | docker build -f other/bootstrap_daemon/docker/Dockerfile -t toxchat/bootstrap-node -
6sudo useradd \ 8sudo useradd \
7 --home-dir /var/lib/tox-bootstrapd \ 9 --home-dir /var/lib/tox-bootstrapd \
8 --create-home \ 10 --create-home \
@@ -29,12 +31,12 @@ fi
29 31
30COUNTER=0 32COUNTER=0
31COUNTER_END=120 33COUNTER_END=120
32while [ $COUNTER -lt $COUNTER_END ]; do 34while [ "$COUNTER" -lt "$COUNTER_END" ]; do
33 if docker logs tox-bootstrapd | grep -q "Connected to another bootstrap node successfully" ; then 35 if docker logs tox-bootstrapd | grep -q "Connected to another bootstrap node successfully"; then
34 break 36 break
35 fi 37 fi
36 sleep 1 38 sleep 1
37 COUNTER=$(($COUNTER+1)) 39 COUNTER=$(($COUNTER + 1))
38done 40done
39 41
40docker logs tox-bootstrapd 42docker logs tox-bootstrapd
@@ -49,18 +51,18 @@ sleep 30
49 51
50docker ps -a 52docker ps -a
51 53
52if [ "`docker inspect -f {{.State.Running}} tox-bootstrapd`" != "true" ]; then 54if [ "$(docker inspect -f {{.State.Running}} tox-bootstrapd)" != "true" ]; then
53 echo "Error: Container is not running" 55 echo "Error: Container is not running"
54 exit 1 56 exit 1
55fi 57fi
56 58
57cat /proc/$(pidof tox-bootstrapd)/limits 59cat /proc/"$(pidof tox-bootstrapd)"/limits
58if ! cat /proc/$(pidof tox-bootstrapd)/limits | grep -P '^Max open files(\s+)32768(\s+)32768(\s+)files'; then 60if ! grep -P '^Max open files(\s+)32768(\s+)32768(\s+)files' /proc/"$(pidof tox-bootstrapd)"/limits; then
59 echo "Error: ulimit is not set to the expected value" 61 echo "Error: ulimit is not set to the expected value"
60 exit 1 62 exit 1
61fi 63fi
62 64
63if ! other/fun/bootstrap_node_info.py ipv4 localhost 33445 ; then 65if ! other/fun/bootstrap_node_info.py ipv4 localhost 33445; then
64 echo "Error: Unable to get bootstrap node info" 66 echo "Error: Unable to get bootstrap node info"
65 exit 1 67 exit 1
66fi 68fi
diff --git a/.travis/upload-coverage b/.travis/upload-coverage
index 08f0e482..d49538d9 100755
--- a/.travis/upload-coverage
+++ b/.travis/upload-coverage
@@ -1,10 +1,10 @@
1#!/bin/bash 1#!/bin/bash
2 2
3# We only submit coverage from the Linux build. 3# We only submit coverage from the Linux build.
4coveralls \ 4coveralls \
5 --exclude auto_tests \ 5 --exclude auto_tests \
6 --exclude other \ 6 --exclude other \
7 --exclude testing \ 7 --exclude testing \
8 --gcov-options '\-lp' 8 --gcov-options '\-lp'
9 9
10bash <(curl -s https://codecov.io/bash) 10bash <(curl -s https://codecov.io/bash)