File: klocwork_check.sh

package info (click to toggle)
embree 3.12.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 27,412 kB
  • sloc: cpp: 173,822; xml: 3,737; ansic: 2,955; python: 1,628; sh: 480; makefile: 193; csh: 42
file content (22 lines) | stat: -rwxr-xr-x 882 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

## Copyright 2009-2020 Intel Corporation
## SPDX-License-Identifier: Apache-2.0

set -e
export KW_BUILD_NUMBER=$(cat ./kw_build_number)
export KW_PROJECT_NAME=embree
export KW_CRITICAL_OUTPUT_PATH=./kw_critical.out

echo "Checking for critical issues in $KW_BUILD_NUMBER ..."
no_proxy=$KW_SERVER_IP curl -f --data "action=search&project=$KW_PROJECT_NAME&query=build:'$KW_BUILD_NUMBER'%20severity:Critical%20status:Analyze,Fix&user=$KW_USER&ltoken=$KW_LTOKEN" http://$KW_SERVER_IP:$KW_SERVER_PORT/review/api -o $KW_CRITICAL_OUTPUT_PATH
getCriticalCount() {
    cat $KW_CRITICAL_OUTPUT_PATH | wc -l
}
if [ -f $KW_CRITICAL_OUTPUT_PATH ]; then
    echo "****** ERROR ****** Critical issues found - $(getCriticalCount) in $KW_BUILD_NUMBER";
    cat $KW_CRITICAL_OUTPUT_PATH
    exit 1;
else
    echo "****** PASS ****** No critical issues were found in $KW_BUILD_NUMBER"
fi