-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcoverity.sh
executable file
·42 lines (32 loc) · 1.43 KB
/
coverity.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
#!/bin/sh
# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
export PATH=/opt/coverity/bin:$PATH
cov-configure --gcc
cov-configure --template --compiler cc --comptype gcc
cov-configure --template --compiler c++ --comptype g++
WASM2NATIVE_DIR=${PWD}
COV_DIR=${PWD}/cov-out
rm -rf ${COV_DIR}
mkdir -p ${COV_DIR}
# wasm2native-compiler with default features
cd ${WASM2NATIVE_DIR}/wasm2native-compiler
rm -fr build && mkdir build && cd build
cov-build --dir ${COV_DIR} cmake .. -DCMAKE_BUILD_TYPE=Debug
cov-build --dir ${COV_DIR} make -j ${nproc}
# wasm2native-vmlib with default features
cd ${WASM2NATIVE_DIR}/wasm2native-vmlib
rm -fr build && mkdir build && cd build
cov-build --dir ${COV_DIR} cmake .. -DCMAKE_BUILD_TYPE=Debug
cov-build --dir ${COV_DIR} make -j ${nproc}
# wasm2native-vmlib with wasm application enabled
cd ${WASM2NATIVE_DIR}/wasm2native-vmlib
rm -fr build && mkdir build && cd build
cov-build --dir ${COV_DIR} cmake .. -DW2N_BUILD_WASM_APPLICATION=1 -DCMAKE_BUILD_TYPE=Debug
cov-build --dir ${COV_DIR} make -j ${nproc}
cov-analyze --dir ${COV_DIR} --concurrency --security --rule \
--enable-constraint-fpp --enable-fnptr --enable-virtual
# Commit the analyze results to server manually
# export PATH=/opt/coverity/bin:$PATH
# cov-commit-defects --dir cov-out -stream Wasm2native \
# --url https://coverityent.devtools.intel.com/prod2/ --user xxx