• Home
  • Raw
  • Download

Lines Matching +full:- +full:- +full:build +full:- +full:and +full:- +full:test

2 # SPDX-License-Identifier: MIT
5 # Use of this source code is governed by an MIT-style
10 # Test script for fsverity-utils. Runs 'make check' in lots of configurations,
11 # runs static analysis, and does a few other tests.
13 # Note: for more test coverage, in addition to running this script, also build
14 # fsverity-utils into a kvm-xfstests test appliance and run
15 # 'kvm-xfstests -c ext4,f2fs -g verity'
17 set -e -u -o pipefail
31 TMPDIR=$(mktemp -d -t libfsverity_test.XXXXXXXXX)
32 trap 'rm -r "$TMPDIR"' EXIT
34 # Both stdout and stderr go to log file.
36 echo "Starting fsverity-utils tests. See run-tests.log for full output."
37 rm -f run-tests.log
38 exec >> run-tests.log
39 exec 2> >(tee -ia run-tests.log 1>&2)
41 MAKE="make -j$(getconf _NPROCESSORS_ONLN)"
47 log "Build and test with statically linking"
48 $MAKE CFLAGS="-Werror"
52 ./fsverity --version
55 if nm libfsverity.a | grep ' T ' | grep -v " libfsverity_"; then
63 log "Build and test with dynamic linking"
64 $MAKE CFLAGS="-Werror" USE_SHARED_LIB=1 check
70 if nm libfsverity.so | grep ' T ' | grep -v " libfsverity_"; then
78 $MAKE CFLAGS="-Werror" libfsverity.so
79 log "Test using libfsverity from C++ program"
80 cat > "$TMPDIR/test.cc" <<EOF
88 c++ -Wall -Werror "$TMPDIR/test.cc" -Iinclude -L. -lfsverity -o "$TMPDIR/test"
89 [ "$(LD_LIBRARY_PATH=. "$TMPDIR/test")" = "32" ]
96 log "Check that build doesn't produce untracked files"
97 $MAKE CFLAGS="-Werror" all test_programs
98 if git status --short | grep -q '^??'; then
100 fail "Build produced untracked files (check 'git status'). Missing gitignore entry?"
107 log "Test that 'make uninstall' uninstalls all files"
109 if [ "$(find "$TMPDIR" -type f -o -type l | wc -l)" = 0 ]; then
113 if [ "$(find "$TMPDIR" -type f -o -type l | wc -l)" != 0 ]; then
116 rm -r "${TMPDIR:?}"/*
122 log "Build, install, and uninstall with dash"
131 log "Check that all files have license and copyright info"
134 # files to exclude from license and copyright info checks
135 grep -E -v '(\.gitignore|LICENSE|.*\.md|testdata|fsverity_uapi\.h|libfsverity\.pc\.in)'
137 git grep -L 'SPDX-License-Identifier: MIT' \
139 if [ -s "$list" ]; then
142 # For now some people still prefer a free-form license statement, not just SPDX.
143 git grep -L 'Use of this source code is governed by an MIT-style' \
145 if [ -s "$list" ]; then
148 git grep -L '\<Copyright\>' | filter_license_info > "$list" || true
149 if [ -s "$list" ]; then
158 log "Build and test with gcc (-O2)"
159 $MAKE CC=gcc CFLAGS="-O2 -Werror" check
161 log "Build and test with gcc (-O3)"
162 $MAKE CC=gcc CFLAGS="-O3 -Werror" check
168 log "Build and test with clang (-O2)"
169 $MAKE CC=clang CFLAGS="-O2 -Werror" check
171 log "Build and test with clang (-O3)"
172 $MAKE CC=clang CFLAGS="-O3 -Werror" check
178 log "Build and test with gcc (32-bit)"
179 $MAKE CC=gcc CFLAGS="-O2 -Werror -m32" check
185 log "Build and test with clang + UBSAN"
187 CFLAGS="-O2 -Werror -fsanitize=undefined -fno-sanitize-recover=undefined" \
190 log "Build and test with clang + ASAN"
192 CFLAGS="-O2 -Werror -fsanitize=address -fno-sanitize-recover=address" \
195 log "Build and test with clang + unsigned integer overflow sanitizer"
197 …CFLAGS="-O2 -Werror -fsanitize=unsigned-integer-overflow -fno-sanitize-recover=unsigned-integer-ov…
200 log "Build and test with clang + CFI"
201 $MAKE CC=clang CFLAGS="-O2 -Werror -fsanitize=cfi -flto -fvisibility=hidden" \
202 AR=llvm-ar check
208 log "Build and test with valgrind"
209 …$MAKE TEST_WRAPPER_PROG="valgrind --quiet --error-exitcode=100 --leak-check=full --errors-for-leak
210 CFLAGS="-O2 -Werror" check
216 log "Build and test using BoringSSL instead of OpenSSL"
217 log "-> Building BoringSSL"
219 log "-> Building fsverity-utils linked to BoringSSL"
220 $MAKE CFLAGS="-O2 -Werror" LDFLAGS="-Lboringssl/build/crypto" \
221 CPPFLAGS="-Iboringssl/include" LDLIBS="-lcrypto -lpthread" check
227 log "Build and test using OpenSSL 1.0"
228 $MAKE CFLAGS="-O2 -Werror" LDFLAGS="-L/usr/lib/openssl-1.0" \
229 CPPFLAGS="-I/usr/include/openssl-1.0" check
235 log "Build and test using OpenSSL 3.0"
237 LD_LIBRARY_PATH="$OSSL3/lib64" $MAKE CFLAGS="-O2 -Werror" \
238 LDFLAGS="-L$OSSL3/lib64" CPPFLAGS="-I$OSSL3/include" check
244 log "Build and test using -funsigned-char"
245 $MAKE CFLAGS="-O2 -Werror -funsigned-char" check
251 log "Build and test using -fsigned-char"
252 $MAKE CFLAGS="-O2 -Werror -fsigned-char" check
258 log "Cross-compile for Windows (32-bit)"
259 $MAKE CC=i686-w64-mingw32-gcc CFLAGS="-O2 -Werror"
261 log "Cross-compile for Windows (64-bit)"
262 $MAKE CC=x86_64-w64-mingw32-gcc CFLAGS="-O2 -Werror"
269 ./scripts/run-sparse.sh
276 scan-build --status-bugs make CFLAGS="-O2 -Werror" all test_programs
306 echo 1>&2 "Unknown test: $tst"