1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

ci: test-self with address sanitized compiler (#8866)

This commit is contained in:
ka-weihe
2021-02-21 15:09:19 +01:00
committed by GitHub
parent 260f677469
commit 1039d39846
2 changed files with 295 additions and 59 deletions

View File

@@ -415,7 +415,7 @@ jobs:
echo "Running it..."
ls
tests-sanitize-undefined:
tests-sanitize-undefined-clang:
runs-on: ubuntu-20.04
timeout-minutes: 30
env:
@@ -434,11 +434,33 @@ jobs:
sudo apt-get install clang
## sudo apt-get install --quiet -y libsdl2-dev libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev
- name: Build V
run: make -j4 && ./v -cc clang -cg -cflags -Werror -o v cmd/v
run: make -j4 && ./v -cg -cflags -Werror -o v cmd/v
- name: Self tests (-fsanitize=undefined)
run: ./v -cc clang -cflags "-fsanitize=undefined" -o v2 cmd/v && ./v2 -cflags -fsanitize=undefined test-self
run: ./v -cflags "-fsanitize=undefined" -o v2 cmd/v && ./v2 -cflags -fsanitize=undefined test-self
tests-sanitize-undefined-gcc:
runs-on: ubuntu-20.04
timeout-minutes: 30
env:
VFLAGS: -cc gcc
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Install dependencies
run: |
sudo rm -f /etc/apt/sources.list.d/dotnetdev.list /etc/apt/sources.list.d/microsoft-prod.list;
sudo apt-get update;
sudo apt-get install --quiet -y postgresql libpq-dev libssl-dev sqlite3 libsqlite3-dev valgrind
sudo apt-get install --quiet -y libglfw3 libglfw3-dev libfreetype6-dev libxi-dev libxcursor-dev libasound2-dev
## sudo apt-get install --quiet -y libsdl2-dev libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev
- name: Build V
run: make -j4 && ./v -cg -cflags -Werror -o v cmd/v
- name: Self tests (-fsanitize=undefined)
run: ./v -cflags "-fsanitize=undefined" -o v2 cmd/v && ./v2 -cflags -fsanitize=undefined test-self
tests-sanitize-address:
tests-sanitize-address-clang:
runs-on: ubuntu-20.04
timeout-minutes: 30
env:
@@ -457,11 +479,67 @@ jobs:
sudo apt-get install clang
## sudo apt-get install --quiet -y libsdl2-dev libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev
- name: Build V
run: make -j4 && ./v -cc clang -cg -cflags -Werror -o v cmd/v
run: make -j4 && ./v -cg -cflags -Werror -o v cmd/v
- name: Self tests (-fsanitize=address)
run: ASAN_OPTIONS=detect_leaks=0 ./v -cflags -fsanitize=address test-self
- name: Self tests (V compiled with -fsanitize=address)
run:
./v -cflags -fsanitize=address -o v cmd/v &&
ASAN_OPTIONS=detect_leaks=0 ./v -cc tcc test-self -asan-compiler
tests-sanitize-address-msvc:
runs-on: windows-2019
timeout-minutes: 30
env:
VFLAGS: -cc msvc
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Build
run: |
echo %VFLAGS%
echo $VFLAGS
.\make.bat -msvc
.\v.exe -cflags /WX self
- name: Install dependencies
run: |
.\v.exe setup-freetype
.\.github\workflows\windows-install-sqlite.bat
## .\.github\workflows\windows-install-sdl.bat
- name: Self tests (-fsanitize=address)
run: |
.\v.exe -cflags "-fsanitize=address" test-self
tests-sanitize-memory:
tests-sanitize-address-gcc:
runs-on: ubuntu-20.04
timeout-minutes: 30
env:
VFLAGS: -cc gcc
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Install dependencies
run: |
sudo rm -f /etc/apt/sources.list.d/dotnetdev.list /etc/apt/sources.list.d/microsoft-prod.list;
sudo apt-get update;
sudo apt-get install --quiet -y postgresql libpq-dev libssl-dev sqlite3 libsqlite3-dev valgrind
sudo apt-get install --quiet -y libglfw3 libglfw3-dev libfreetype6-dev libxi-dev libxcursor-dev libasound2-dev
sudo apt-get install clang
## sudo apt-get install --quiet -y libsdl2-dev libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev
- name: Build V
run: make -j4 && ./v -cg -cflags -Werror -o v cmd/v
- name: Self tests (-fsanitize=address)
run: ASAN_OPTIONS=detect_leaks=0 ./v -cflags -fsanitize=address test-self
- name: Self tests (V compiled with -fsanitize=address)
run:
./v -cflags -fsanitize=address -o v cmd/v &&
ASAN_OPTIONS=detect_leaks=0 ./v -cc tcc test-self -asan-compiler
tests-sanitize-memory-clang:
runs-on: ubuntu-20.04
timeout-minutes: 30
env: