forked from TokTok/c-toxcore
-
-
Notifications
You must be signed in to change notification settings - Fork 5
99 lines (93 loc) · 3.41 KB
/
custom_tests_asan.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: custom_tests_asan
on:
push:
pull_request:
schedule:
- cron: '3 */8 * * *'
jobs:
linux-custom-tests:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: mmap rnd_bits workaround
run: |
sudo sysctl -w vm.mmap_rnd_bits=28
- run: |
sudo apt-get update && \
sudo DEBIAN_FRONTEND=noninteractive apt-get remove g++ && \
sudo DEBIAN_FRONTEND=noninteractive \
apt-get install -y --no-install-recommends \
ca-certificates \
coreutils \
clang \
cmake \
git \
tor \
curl \
libconfig-dev \
libgtest-dev \
libopus-dev \
libsodium-dev \
libvpx-dev \
llvm-dev \
ninja-build \
pkg-config \
libavutil-dev \
libavcodec-dev \
libavformat-dev \
libavfilter-dev \
libx264-dev \
libx265-dev
- name: setup tor
run: |
sudo /etc/init.d/tor restart
ps -ef|grep tor
cat /usr/share/tor/tor-service-defaults-torrc
- name: test tor connection
run: |
set -x
curl -x socks5h://localhost:9050 -s https://check.torproject.org/api/ip || echo "ignore error"
- run: git submodule update --init --recursive
- name: build toxcore
run: |
CC=clang cmake -B_build -H. -GNinja \
-DCMAKE_INSTALL_PREFIX:PATH="$PWD/_install" \
-DCMAKE_C_FLAGS="-g -O1 -Wno-everything -Wno-missing-variable-declarations -fno-omit-frame-pointer -fsanitize=address" \
-DCMAKE_CXX_FLAGS="-g -O1 -Wno-everything -Wno-missing-variable-declarations -fno-omit-frame-pointer -fsanitize=address" \
-DCMAKE_EXE_LINKER_FLAGS="-g -O1 -Wno-everything -Wno-missing-variable-declarations -fno-omit-frame-pointer -fsanitize=address" \
-DCMAKE_SHARED_LINKER_FLAGS="-g -O1 -Wno-everything -Wno-missing-variable-declarations -fno-omit-frame-pointer -fsanitize=address" \
-DMIN_LOGGER_LEVEL=INFO \
-DMUST_BUILD_TOXAV=ON \
-DNON_HERMETIC_TESTS=OFF \
-DSTRICT_ABI=OFF \
-DUSE_IPV6=OFF \
-DAUTOTEST=OFF \
-DBUILD_MISC_TESTS=OFF \
-DBUILD_FUN_UTILS=OFF
cd _build
ninja install -j"$(nproc)"
- name: run custom tests
run: |
pwd
export TEST_MAX_TIME=$[10*60] # 10 minutes
ls -1 ./custom_tests/*.c
export PKG_CONFIG_PATH="$PWD"/_install/lib/pkgconfig
export LD_LIBRARY_PATH="$PWD"/_install/lib
for i in $(ls -1 ./custom_tests/*.c) ; do
echo "CCC:--------------- ""$i"" ---------------"
rm -f test
clang -g -O1 -fno-omit-frame-pointer -fsanitize=address \
-Wno-everything -Wno-missing-variable-declarations \
$(pkg-config --cflags toxcore libavcodec libavutil x264 x265 opus vpx libsodium) \
$(pkg-config --libs toxcore libavcodec libavutil x264 x265 opus vpx libsodium) \
"$i" \
-o test
echo "RUN:--------------- ""$i"" ---------------"
timeout -v -k ${TEST_MAX_TIME} $[${TEST_MAX_TIME}+1] ./test
if [ $? -ne 0 ]; then
echo "ERR:--------------- ""$i"" ---------------"
exit $?
else
echo "OK :*************** ""$i"" ***************"
fi
done