-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstaticAnalysis.sh
66 lines (59 loc) · 2.97 KB
/
staticAnalysis.sh
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
#!/usr/bin/env bash
# Run CPPCheck
echo "
**************************************************
Starting CPPCheck
**************************************************"
cppcheck src tests -iexternal/ -I src/ -I tests/ --enable=all --quiet --suppress=missingIncludeSystem
# Run Clang-Tidy using cmake
echo "
**************************************************
Starting Clang-Tidy
**************************************************"
cmake -DBUILD_TESTING=ON -DCODE_COVERAGE=OFF -DSTATIC_ANALYSIS=OFF -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_CLANG_TIDY=clang-tidy-9 .
cmake --build . --clean-first -- -j $(nproc)
ctest --output-on-failure --quiet -j $(nproc) -C Debug .
# Run Valgrind
echo "
**************************************************
Starting Memory Sanitizer (valgrind)
**************************************************"
cmake -DSTATIC_ANALYSIS=ON -UCMAKE_CXX_CLANG_TIDY .
cmake --clean-first .
ctest --output-on-failure --quiet -j $(nproc) -C Debug -D ExperimentalBuild .
ctest --output-on-failure --quiet -j $(nproc) -C Debug -D ExperimentalTest .
ctest --output-on-failure --quiet -j $(nproc) -C Debug -D ExperimentalMemCheck .
echo "Dumping Logs"
echo "$(<${TRAVIS_BUILD_DIR}/Testing/Temporary/MemoryChecker.1.log)"
# Address Sanitizers
echo "
**************************************************
Starting Address Sanitizer
**************************************************"
cmake -DSTATIC_ANALYSIS=OFF -DCMAKE_CXX_FLAGS="-g -O0 -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize=address" -DCMAKE_EXE_LINKER_FLAGS="-g -O0 -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize=address" .
cmake --build . --clean-first -- -j $(nproc)
ctest --output-on-failure --quiet -j $(nproc) -C Debug .
# Undefined Behaviour Sanitizer
echo "
**************************************************
Starting Undefined-Behaviour Sanitizer
**************************************************"
cmake -DCMAKE_CXX_FLAGS="-g -O0 -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize=undefined" -DCMAKE_EXE_LINKER_FLAGS="-g -O0 -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize=undefined" .
cmake --build . --clean-first -- -j $(nproc)
ctest --output-on-failure --quiet -j $(nproc) -C Debug .
# Thread Sanitizer
echo "
**************************************************
Starting Thread Sanitizer
**************************************************"
cmake -DCMAKE_CXX_FLAGS="-g -O0 -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize=thread" -DCMAKE_EXE_LINKER_FLAGS="-g -O0 -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize=thread" .
cmake --build . --clean-first -- -j $(nproc)
ctest --output-on-failure --quiet -j $(nproc) -C Debug .
# OCLint quality reporting
echo "
**************************************************
Starting OCLint
**************************************************"
cmake -DCMAKE_CXX_FLAGS="-g -O0" -DCMAKE_EXE_LINKER_FLAGS="-g -O0" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .
cmake --build . --clean-first -- -j $(nproc)
oclint-json-compilation-database -i src -i tests -e external