Debian Codegraph @

etc/ci/test-fiat-c-boringssl.sh

raw symbols SCIP
1 #!/usr/bin/env bash
2 # USAGE: $0 SUBCOMPONENT (e.g., fiat-c/src)
3
4 ################################################################################
5 # Tests for BoringSSL
6 ################################################################################
7 echo "::group::Cloning BoringSSL"
8 ({
9 set -ex
10 rm -rf boringssl
11 git clone https://boringssl.googlesource.com/boringssl || exit $?
12 git -C boringssl log -1
13 }) || exit $?
14 echo "::endgroup::"
15
16 SUBCOMPONENT="$1"
17 if [ -z "$SUBCOMPONENT" ]; then
18 echo "ERROR: Missing argument"
19 echo "USAGE: $0 SUBCOMPONENT"
20 echo "Example SUBCOMPONENTS include fiat-c/src, fiat-bedrock2/src"
21 exit 1
22 fi
23 SUBCOMPONENT_PATH="$(cd "$SUBCOMPONENT" && pwd)"
24
25 pushd boringssl >/dev/null
26
27 echo "::group::Patching BoringSSL"
28 ({
29 set -ex
30 ( cd third_party/fiat &&
31 for i in "curve25519_32.h" "curve25519_64.h" "p256_32.h" "p256_64.h"; do
32 cp "${SUBCOMPONENT_PATH}/${i/.h/.c}" "$i" || exit $?
33 done ) || exit $?
34 ( cd third_party/fiat && git --no-pager diff )
35 }) || exit $?
36 echo "::endgroup::"
37
38 echo "::group::Building BoringSSL"
39 ({
40 set -ex
41 mkdir build
42 cd build
43 cmake -GNinja .. -DOPENSSL_NO_ASM=1 -DCMAKE_CXX_FLAGS="-Wno-error=unused-function ${EXTRA_CFLAGS}" -DCMAKE_C_FLAGS="-Wno-error=unused-function ${EXTRA_CFLAGS}" || exit $?
44 ninja || exit $?
45 }) || exit $?
46 echo "::endgroup::"
47
48 echo "::group::Testing BoringSSL"
49 ({
50 set -ex
51 ninja -C build run_tests || exit $?
52 }) || exit $?
53 echo "::endgroup::"
54
55 popd >/dev/null