xref: /aosp_15_r20/external/swiftshader/tests/kokoro/gcp_ubuntu/check_style.sh (revision 03ce13f70fcc45d86ee91b7ee4cab1936a95046e)
1#!/bin/bash
2
3set -x # Display commands being run.
4
5SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd )"
6
7# Download Clang tar
8CLANG_PACKAGE="clang+llvm-11.0.1-x86_64-linux-gnu-ubuntu-16.04"
9curl -L https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.1/${CLANG_PACKAGE}.tar.xz > /tmp/clang.tar.xz
10# Verify Clang tar
11sudo apt-get install pgpgpg
12gpg --import "${SCRIPT_DIR}/tstellar-gpg-key.asc"
13gpg --verify "${SCRIPT_DIR}/${CLANG_PACKAGE}.tar.xz.sig" /tmp/clang.tar.xz
14if [ $? -ne 0 ]
15then
16  echo "clang download failed PGP check"
17  exit 1
18fi
19
20set -e # Fail on any error
21
22# Untar into tmp
23mkdir /tmp/clang
24tar -xf /tmp/clang.tar.xz -C /tmp/clang
25
26# Set up env vars
27export CLANG_FORMAT=/tmp/clang/${CLANG_PACKAGE}/bin/clang-format
28
29# Run presubmit tests
30cd git/SwiftShader
31./tests/presubmit.sh
32