-
Notifications
You must be signed in to change notification settings - Fork 166
73 lines (68 loc) · 2.4 KB
/
ci-asan-ubsan.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
---
name: "CILeaktests"
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
citests:
name: CI-Leaks
runs-on: ubuntu-latest
env:
PTLS_CMAKE_OPTS: "-DCMAKE_C_FLAGS=-fsanitize=address,undefined -DCMAKE_CXX_FLAGS=-fsanitize=address,undefined"
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
submodules: 'recursive'
- name: Building picoquic
run: |
sudo apt-get install -y libssl-dev
./ci/build_picotls.sh
cmake -DENABLE_ASAN=ON -DENABLE_UBSAN=on .
make
- name: Perform Unit Tests and Check for Leaks
run: |
ulimit -c unlimited -S
./picoquic_ct -n -r 1>quic_ct.txt 2>sanity.txt || QUICRESULT=$?
echo "running picoquic_ct returns <$QUICRESULT> "
cat sanity.txt
if [ ! -z ${QUICRESULT} ]; then
if [ ${QUICRESULT} != 0 ]; then exit 1; fi;
fi
leaked=`grep "SUMMARY: AddressSanitizer:" sanity.txt | cut -d ' ' -f 3`
previous_leak=0
if [ ! -z "$leaked" ]; then
if [ $leaked -gt $previous_leak ]; then
echo "$leaked > $previous_leak"; exit 1;
else
echo "$leaked <= $previous_leak";
fi
else
echo "No leaks detected in picoquic_ct"
fi
#./picohttp_ct -n -r 1>http_ct.txt 2>sanity.txt || QUICHTTPRESULT=$?
./picohttp_ct -n -r 2>sanity.txt || QUICHTTPRESULT=$?
echo "running picohttp_ct returns <$QUICHTTPRESULT> "
cat sanity.txt
if [ ! -z ${QUICHTTPRESULT} ]; then
if [ ${QUICHTTPRESULT} != 0 ]; then exit 1; fi;
fi
leaked=`grep "SUMMARY: AddressSanitizer:" sanity.txt | cut -d ' ' -f 3`
previous_leak=0
if [ ! -z "$leaked" ]; then
if [ $leaked -gt $previous_leak ]; then
echo "$leaked > $previous_leak"; exit 1;
else
echo "$leaked <= $previous_leak";
fi
else
echo "No leaks detected in picohttp_ct"
fi
exit 0