SimonB | 21ab9d7 | 2016-03-12 20:37:32 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Tom Cosgrove | fc2ac75 | 2022-11-30 11:13:00 +0000 | [diff] [blame] | 3 | # basic-build-test.sh |
SimonB | 21ab9d7 | 2016-03-12 20:37:32 +0000 | [diff] [blame] | 4 | # |
Bence Szépkúti | 1e14827 | 2020-08-07 13:07:28 +0200 | [diff] [blame] | 5 | # Copyright The Mbed TLS Contributors |
Dave Rodgman | 16799db | 2023-11-02 19:47:20 +0000 | [diff] [blame] | 6 | # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later |
Bence Szépkúti | c7da1fe | 2020-05-26 01:54:15 +0200 | [diff] [blame] | 7 | # |
SimonB | 21ab9d7 | 2016-03-12 20:37:32 +0000 | [diff] [blame] | 8 | # Purpose |
| 9 | # |
| 10 | # Executes the basic test suites, captures the results, and generates a simple |
| 11 | # test report and code coverage report. |
| 12 | # |
| 13 | # The tests include: |
SimonB | 21ab9d7 | 2016-03-12 20:37:32 +0000 | [diff] [blame] | 14 | # * Unit tests - executed using tests/scripts/run-test-suite.pl |
Paul Bakker | 4b8bc52 | 2016-07-20 09:52:01 +0100 | [diff] [blame] | 15 | # * Self-tests - executed using the test suites above |
SimonB | 21ab9d7 | 2016-03-12 20:37:32 +0000 | [diff] [blame] | 16 | # * System tests - executed using tests/ssl-opt.sh |
| 17 | # * Interoperability tests - executed using tests/compat.sh |
| 18 | # |
| 19 | # The tests focus on functionality and do not consider performance. |
| 20 | # |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 21 | # Note the tests self-adapt due to configurations in include/mbedtls/mbedtls_config.h |
SimonB | 21ab9d7 | 2016-03-12 20:37:32 +0000 | [diff] [blame] | 22 | # which can lead to some tests being skipped, and can cause the number of |
Paul Bakker | 4b8bc52 | 2016-07-20 09:52:01 +0100 | [diff] [blame] | 23 | # available tests to fluctuate. |
SimonB | 21ab9d7 | 2016-03-12 20:37:32 +0000 | [diff] [blame] | 24 | # |
| 25 | # This script has been written to be generic and should work on any shell. |
| 26 | # |
Tom Cosgrove | fc2ac75 | 2022-11-30 11:13:00 +0000 | [diff] [blame] | 27 | # Usage: basic-build-test.sh |
SimonB | 21ab9d7 | 2016-03-12 20:37:32 +0000 | [diff] [blame] | 28 | # |
| 29 | |
| 30 | # Abort on errors (and uninitiliased variables) |
| 31 | set -eu |
| 32 | |
| 33 | if [ -d library -a -d include -a -d tests ]; then :; else |
Gilles Peskine | e820c0a | 2023-08-03 17:45:20 +0200 | [diff] [blame] | 34 | echo "Must be run from Mbed TLS root" >&2 |
SimonB | 21ab9d7 | 2016-03-12 20:37:32 +0000 | [diff] [blame] | 35 | exit 1 |
| 36 | fi |
| 37 | |
Andres AG | b2fdd04 | 2016-09-22 14:17:46 +0100 | [diff] [blame] | 38 | : ${OPENSSL:="openssl"} |
Andres AG | b2fdd04 | 2016-09-22 14:17:46 +0100 | [diff] [blame] | 39 | : ${GNUTLS_CLI:="gnutls-cli"} |
| 40 | : ${GNUTLS_SERV:="gnutls-serv"} |
Andres AG | b2fdd04 | 2016-09-22 14:17:46 +0100 | [diff] [blame] | 41 | |
Manuel Pégourié-Gonnard | e050191 | 2020-06-08 12:59:27 +0200 | [diff] [blame] | 42 | # Used to make ssl-opt.sh deterministic. |
Manuel Pégourié-Gonnard | 5430447 | 2020-06-22 10:11:47 +0200 | [diff] [blame] | 43 | # |
| 44 | # See also RELEASE_SEED in all.sh. Debugging is easier if both values are kept |
| 45 | # in sync. If you change the value here because it breaks some tests, you'll |
| 46 | # definitely want to change it in all.sh as well. |
Manuel Pégourié-Gonnard | e050191 | 2020-06-08 12:59:27 +0200 | [diff] [blame] | 47 | : ${SEED:=1} |
| 48 | export SEED |
| 49 | |
Gilles Peskine | a3d2264 | 2021-07-13 23:23:23 +0200 | [diff] [blame] | 50 | # if MAKEFLAGS is not set add the -j option to speed up invocations of make |
| 51 | if [ -z "${MAKEFLAGS+set}" ]; then |
| 52 | export MAKEFLAGS="-j" |
| 53 | fi |
| 54 | |
Andres AG | b2fdd04 | 2016-09-22 14:17:46 +0100 | [diff] [blame] | 55 | # To avoid setting OpenSSL and GnuTLS for each call to compat.sh and ssl-opt.sh |
| 56 | # we just export the variables they require |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 57 | export OPENSSL="$OPENSSL" |
Andres AG | b2fdd04 | 2016-09-22 14:17:46 +0100 | [diff] [blame] | 58 | export GNUTLS_CLI="$GNUTLS_CLI" |
| 59 | export GNUTLS_SERV="$GNUTLS_SERV" |
| 60 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 61 | CONFIG_H='include/mbedtls/mbedtls_config.h' |
Janos Follath | 7ccac85 | 2016-06-06 13:18:39 +0100 | [diff] [blame] | 62 | CONFIG_BAK="$CONFIG_H.bak" |
SimonB | 21ab9d7 | 2016-03-12 20:37:32 +0000 | [diff] [blame] | 63 | |
Janos Follath | b72c678 | 2016-07-19 14:54:17 +0100 | [diff] [blame] | 64 | # Step 0 - print build environment info |
Andres AG | b2fdd04 | 2016-09-22 14:17:46 +0100 | [diff] [blame] | 65 | OPENSSL="$OPENSSL" \ |
Andres AG | b2fdd04 | 2016-09-22 14:17:46 +0100 | [diff] [blame] | 66 | GNUTLS_CLI="$GNUTLS_CLI" \ |
| 67 | GNUTLS_SERV="$GNUTLS_SERV" \ |
Andres AG | b2fdd04 | 2016-09-22 14:17:46 +0100 | [diff] [blame] | 68 | scripts/output_env.sh |
Janos Follath | b72c678 | 2016-07-19 14:54:17 +0100 | [diff] [blame] | 69 | echo |
| 70 | |
SimonB | 21ab9d7 | 2016-03-12 20:37:32 +0000 | [diff] [blame] | 71 | # Step 1 - Make and instrumented build for code coverage |
Simon Butcher | c2b0efc | 2016-03-18 18:28:43 +0000 | [diff] [blame] | 72 | export CFLAGS=' --coverage -g3 -O0 ' |
Philippe Antoine | 702c659 | 2019-07-09 17:44:53 +0200 | [diff] [blame] | 73 | export LDFLAGS=' --coverage' |
SimonB | 098a3b5 | 2016-04-16 21:56:59 +0100 | [diff] [blame] | 74 | make clean |
Janos Follath | 7ccac85 | 2016-06-06 13:18:39 +0100 | [diff] [blame] | 75 | cp "$CONFIG_H" "$CONFIG_BAK" |
Gilles Peskine | 5d46f6a | 2019-07-27 23:52:53 +0200 | [diff] [blame] | 76 | scripts/config.py full |
Ronald Cron | fd79fe5 | 2024-07-29 09:43:10 +0200 | [diff] [blame] | 77 | make |
SimonB | 21ab9d7 | 2016-03-12 20:37:32 +0000 | [diff] [blame] | 78 | |
| 79 | |
| 80 | # Step 2 - Execute the tests |
| 81 | TEST_OUTPUT=out_${PPID} |
Gilles Peskine | 24515f9 | 2024-09-11 12:46:08 +0200 | [diff] [blame] | 82 | cd tests |
Gilles Peskine | 3c8ccc0 | 2019-05-20 11:39:18 +0200 | [diff] [blame] | 83 | if [ ! -f "seedfile" ]; then |
Gilles Peskine | bfcb6e1 | 2020-04-09 18:33:34 +0200 | [diff] [blame] | 84 | dd if=/dev/urandom of="seedfile" bs=64 count=1 |
Gilles Peskine | 3c8ccc0 | 2019-05-20 11:39:18 +0200 | [diff] [blame] | 85 | fi |
Gilles Peskine | 282abb5 | 2024-09-11 12:49:50 +0200 | [diff] [blame^] | 86 | if [ ! -f "../tf-psa-crypto/tests/seedfile" ]; then |
| 87 | cp "seedfile" "../tf-psa-crypto/tests/seedfile" |
| 88 | fi |
Gilles Peskine | 40be51f | 2020-04-09 18:50:08 +0200 | [diff] [blame] | 89 | echo |
SimonB | 21ab9d7 | 2016-03-12 20:37:32 +0000 | [diff] [blame] | 90 | |
Gilles Peskine | ca51b47 | 2020-04-09 18:29:42 +0200 | [diff] [blame] | 91 | # Step 2a - Unit Tests (keep going even if some tests fail) |
Gilles Peskine | 40be51f | 2020-04-09 18:50:08 +0200 | [diff] [blame] | 92 | echo '################ Unit tests ################' |
Gilles Peskine | 24515f9 | 2024-09-11 12:46:08 +0200 | [diff] [blame] | 93 | perl scripts/run-test-suites.pl -v 2 |tee unit-test-$TEST_OUTPUT |
Gilles Peskine | 40be51f | 2020-04-09 18:50:08 +0200 | [diff] [blame] | 94 | echo '^^^^^^^^^^^^^^^^ Unit tests ^^^^^^^^^^^^^^^^' |
SimonB | 21ab9d7 | 2016-03-12 20:37:32 +0000 | [diff] [blame] | 95 | echo |
| 96 | |
Gilles Peskine | ca51b47 | 2020-04-09 18:29:42 +0200 | [diff] [blame] | 97 | # Step 2b - System Tests (keep going even if some tests fail) |
Gilles Peskine | 40be51f | 2020-04-09 18:50:08 +0200 | [diff] [blame] | 98 | echo |
| 99 | echo '################ ssl-opt.sh ################' |
Gilles Peskine | bbced87 | 2021-07-13 23:26:00 +0200 | [diff] [blame] | 100 | echo "ssl-opt.sh will use SEED=$SEED for udp_proxy" |
SimonB | 21ab9d7 | 2016-03-12 20:37:32 +0000 | [diff] [blame] | 101 | sh ssl-opt.sh |tee sys-test-$TEST_OUTPUT |
Gilles Peskine | 40be51f | 2020-04-09 18:50:08 +0200 | [diff] [blame] | 102 | echo '^^^^^^^^^^^^^^^^ ssl-opt.sh ^^^^^^^^^^^^^^^^' |
SimonB | 21ab9d7 | 2016-03-12 20:37:32 +0000 | [diff] [blame] | 103 | echo |
| 104 | |
Gilles Peskine | ca51b47 | 2020-04-09 18:29:42 +0200 | [diff] [blame] | 105 | # Step 2c - Compatibility tests (keep going even if some tests fail) |
Gilles Peskine | 40be51f | 2020-04-09 18:50:08 +0200 | [diff] [blame] | 106 | echo '################ compat.sh ################' |
| 107 | { |
Manuel Pégourié-Gonnard | eb86b90 | 2024-04-22 10:25:09 +0200 | [diff] [blame] | 108 | echo '#### compat.sh: Default versions' |
| 109 | sh compat.sh -e 'ARIA\|CHACHA' |
Gilles Peskine | 40be51f | 2020-04-09 18:50:08 +0200 | [diff] [blame] | 110 | echo |
| 111 | |
Manuel Pégourié-Gonnard | eb86b90 | 2024-04-22 10:25:09 +0200 | [diff] [blame] | 112 | echo '#### compat.sh: next (ARIA, ChaCha)' |
| 113 | OPENSSL="$OPENSSL_NEXT" sh compat.sh -e '^$' -f 'ARIA\|CHACHA' |
Gilles Peskine | 40be51f | 2020-04-09 18:50:08 +0200 | [diff] [blame] | 114 | echo |
| 115 | } | tee compat-test-$TEST_OUTPUT |
| 116 | echo '^^^^^^^^^^^^^^^^ compat.sh ^^^^^^^^^^^^^^^^' |
SimonB | 21ab9d7 | 2016-03-12 20:37:32 +0000 | [diff] [blame] | 117 | echo |
| 118 | |
| 119 | # Step 3 - Process the coverage report |
| 120 | cd .. |
Gilles Peskine | 5757d54 | 2020-04-09 18:32:48 +0200 | [diff] [blame] | 121 | { |
| 122 | make lcov |
| 123 | echo SUCCESS |
| 124 | } | tee tests/cov-$TEST_OUTPUT |
| 125 | |
| 126 | if [ "$(tail -n1 tests/cov-$TEST_OUTPUT)" != "SUCCESS" ]; then |
| 127 | echo >&2 "Fatal: 'make lcov' failed" |
| 128 | exit 2 |
| 129 | fi |
SimonB | 21ab9d7 | 2016-03-12 20:37:32 +0000 | [diff] [blame] | 130 | |
| 131 | |
| 132 | # Step 4 - Summarise the test report |
| 133 | echo |
| 134 | echo "=========================================================================" |
| 135 | echo "Test Report Summary" |
| 136 | echo |
| 137 | |
Gilles Peskine | 6ee3b7e | 2021-07-22 11:08:30 +0200 | [diff] [blame] | 138 | # A failure of the left-hand side of a pipe is ignored (this is a limitation |
| 139 | # of sh). We'll use the presence of this file as a marker that the generation |
| 140 | # of the report succeeded. |
Gilles Peskine | d8d1932 | 2021-07-22 12:29:27 +0200 | [diff] [blame] | 141 | rm -f "tests/basic-build-test-$$.ok" |
Gilles Peskine | 6ee3b7e | 2021-07-22 11:08:30 +0200 | [diff] [blame] | 142 | |
Gilles Peskine | fc70b52 | 2021-07-13 23:27:01 +0200 | [diff] [blame] | 143 | { |
SimonB | 21ab9d7 | 2016-03-12 20:37:32 +0000 | [diff] [blame] | 144 | |
Gilles Peskine | fc70b52 | 2021-07-13 23:27:01 +0200 | [diff] [blame] | 145 | cd tests |
SimonB | 21ab9d7 | 2016-03-12 20:37:32 +0000 | [diff] [blame] | 146 | |
Gilles Peskine | 24515f9 | 2024-09-11 12:46:08 +0200 | [diff] [blame] | 147 | # Step 4a - Unit tests |
| 148 | echo "Unit tests - tests/scripts/run-test-suites.pl" |
SimonB | 21ab9d7 | 2016-03-12 20:37:32 +0000 | [diff] [blame] | 149 | |
Gilles Peskine | 24515f9 | 2024-09-11 12:46:08 +0200 | [diff] [blame] | 150 | PASSED_TESTS=$(tail -n6 unit-test-$TEST_OUTPUT|sed -n -e 's/test cases passed :[\t]*\([0-9]*\)/\1/p'| tr -d ' ') |
| 151 | SKIPPED_TESTS=$(tail -n6 unit-test-$TEST_OUTPUT|sed -n -e 's/skipped :[ \t]*\([0-9]*\)/\1/p'| tr -d ' ') |
| 152 | TOTAL_SUITES=$(tail -n6 unit-test-$TEST_OUTPUT|sed -n -e 's/.* (\([0-9]*\) .*, [0-9]* tests run)/\1/p'| tr -d ' ') |
| 153 | FAILED_TESTS=$(tail -n6 unit-test-$TEST_OUTPUT|sed -n -e 's/failed :[\t]*\([0-9]*\)/\1/p' |tr -d ' ') |
SimonB | 21ab9d7 | 2016-03-12 20:37:32 +0000 | [diff] [blame] | 154 | |
Gilles Peskine | fc70b52 | 2021-07-13 23:27:01 +0200 | [diff] [blame] | 155 | echo "No test suites : $TOTAL_SUITES" |
| 156 | echo "Passed : $PASSED_TESTS" |
| 157 | echo "Failed : $FAILED_TESTS" |
| 158 | echo "Skipped : $SKIPPED_TESTS" |
| 159 | echo "Total exec'd tests : $(($PASSED_TESTS + $FAILED_TESTS))" |
| 160 | echo "Total avail tests : $(($PASSED_TESTS + $FAILED_TESTS + $SKIPPED_TESTS))" |
| 161 | echo |
SimonB | 21ab9d7 | 2016-03-12 20:37:32 +0000 | [diff] [blame] | 162 | |
Gilles Peskine | fc70b52 | 2021-07-13 23:27:01 +0200 | [diff] [blame] | 163 | TOTAL_PASS=$PASSED_TESTS |
| 164 | TOTAL_FAIL=$FAILED_TESTS |
| 165 | TOTAL_SKIP=$SKIPPED_TESTS |
| 166 | TOTAL_AVAIL=$(($PASSED_TESTS + $FAILED_TESTS + $SKIPPED_TESTS)) |
| 167 | TOTAL_EXED=$(($PASSED_TESTS + $FAILED_TESTS)) |
SimonB | 21ab9d7 | 2016-03-12 20:37:32 +0000 | [diff] [blame] | 168 | |
Gilles Peskine | 24515f9 | 2024-09-11 12:46:08 +0200 | [diff] [blame] | 169 | # Step 4b - TLS Options tests |
Gilles Peskine | fc70b52 | 2021-07-13 23:27:01 +0200 | [diff] [blame] | 170 | echo "TLS Options tests - tests/ssl-opt.sh" |
SimonB | 21ab9d7 | 2016-03-12 20:37:32 +0000 | [diff] [blame] | 171 | |
Gilles Peskine | fc70b52 | 2021-07-13 23:27:01 +0200 | [diff] [blame] | 172 | PASSED_TESTS=$(tail -n5 sys-test-$TEST_OUTPUT|sed -n -e 's/.* (\([0-9]*\) \/ [0-9]* tests ([0-9]* skipped))$/\1/p') |
| 173 | SKIPPED_TESTS=$(tail -n5 sys-test-$TEST_OUTPUT|sed -n -e 's/.* ([0-9]* \/ [0-9]* tests (\([0-9]*\) skipped))$/\1/p') |
| 174 | TOTAL_TESTS=$(tail -n5 sys-test-$TEST_OUTPUT|sed -n -e 's/.* ([0-9]* \/ \([0-9]*\) tests ([0-9]* skipped))$/\1/p') |
| 175 | FAILED_TESTS=$(($TOTAL_TESTS - $PASSED_TESTS)) |
SimonB | 21ab9d7 | 2016-03-12 20:37:32 +0000 | [diff] [blame] | 176 | |
Gilles Peskine | fc70b52 | 2021-07-13 23:27:01 +0200 | [diff] [blame] | 177 | echo "Passed : $PASSED_TESTS" |
| 178 | echo "Failed : $FAILED_TESTS" |
| 179 | echo "Skipped : $SKIPPED_TESTS" |
| 180 | echo "Total exec'd tests : $TOTAL_TESTS" |
| 181 | echo "Total avail tests : $(($TOTAL_TESTS + $SKIPPED_TESTS))" |
| 182 | echo |
| 183 | |
| 184 | TOTAL_PASS=$(($TOTAL_PASS+$PASSED_TESTS)) |
| 185 | TOTAL_FAIL=$(($TOTAL_FAIL+$FAILED_TESTS)) |
| 186 | TOTAL_SKIP=$(($TOTAL_SKIP+$SKIPPED_TESTS)) |
| 187 | TOTAL_AVAIL=$(($TOTAL_AVAIL + $TOTAL_TESTS + $SKIPPED_TESTS)) |
| 188 | TOTAL_EXED=$(($TOTAL_EXED + $TOTAL_TESTS)) |
SimonB | 21ab9d7 | 2016-03-12 20:37:32 +0000 | [diff] [blame] | 189 | |
| 190 | |
Gilles Peskine | 24515f9 | 2024-09-11 12:46:08 +0200 | [diff] [blame] | 191 | # Step 4c - System Compatibility tests |
Gilles Peskine | fc70b52 | 2021-07-13 23:27:01 +0200 | [diff] [blame] | 192 | echo "System/Compatibility tests - tests/compat.sh" |
SimonB | 21ab9d7 | 2016-03-12 20:37:32 +0000 | [diff] [blame] | 193 | |
Gilles Peskine | fc70b52 | 2021-07-13 23:27:01 +0200 | [diff] [blame] | 194 | PASSED_TESTS=$(cat compat-test-$TEST_OUTPUT | sed -n -e 's/.* (\([0-9]*\) \/ [0-9]* tests ([0-9]* skipped))$/\1/p' | awk 'BEGIN{ s = 0 } { s += $1 } END{ print s }') |
| 195 | SKIPPED_TESTS=$(cat compat-test-$TEST_OUTPUT | sed -n -e 's/.* ([0-9]* \/ [0-9]* tests (\([0-9]*\) skipped))$/\1/p' | awk 'BEGIN{ s = 0 } { s += $1 } END{ print s }') |
| 196 | EXED_TESTS=$(cat compat-test-$TEST_OUTPUT | sed -n -e 's/.* ([0-9]* \/ \([0-9]*\) tests ([0-9]* skipped))$/\1/p' | awk 'BEGIN{ s = 0 } { s += $1 } END{ print s }') |
| 197 | FAILED_TESTS=$(($EXED_TESTS - $PASSED_TESTS)) |
SimonB | 21ab9d7 | 2016-03-12 20:37:32 +0000 | [diff] [blame] | 198 | |
Gilles Peskine | fc70b52 | 2021-07-13 23:27:01 +0200 | [diff] [blame] | 199 | echo "Passed : $PASSED_TESTS" |
| 200 | echo "Failed : $FAILED_TESTS" |
| 201 | echo "Skipped : $SKIPPED_TESTS" |
| 202 | echo "Total exec'd tests : $EXED_TESTS" |
| 203 | echo "Total avail tests : $(($EXED_TESTS + $SKIPPED_TESTS))" |
| 204 | echo |
SimonB | 21ab9d7 | 2016-03-12 20:37:32 +0000 | [diff] [blame] | 205 | |
Gilles Peskine | fc70b52 | 2021-07-13 23:27:01 +0200 | [diff] [blame] | 206 | TOTAL_PASS=$(($TOTAL_PASS+$PASSED_TESTS)) |
| 207 | TOTAL_FAIL=$(($TOTAL_FAIL+$FAILED_TESTS)) |
| 208 | TOTAL_SKIP=$(($TOTAL_SKIP+$SKIPPED_TESTS)) |
| 209 | TOTAL_AVAIL=$(($TOTAL_AVAIL + $EXED_TESTS + $SKIPPED_TESTS)) |
| 210 | TOTAL_EXED=$(($TOTAL_EXED + $EXED_TESTS)) |
SimonB | 21ab9d7 | 2016-03-12 20:37:32 +0000 | [diff] [blame] | 211 | |
| 212 | |
Gilles Peskine | 24515f9 | 2024-09-11 12:46:08 +0200 | [diff] [blame] | 213 | # Step 4d - Grand totals |
Gilles Peskine | fc70b52 | 2021-07-13 23:27:01 +0200 | [diff] [blame] | 214 | echo "-------------------------------------------------------------------------" |
| 215 | echo "Total tests" |
SimonB | 21ab9d7 | 2016-03-12 20:37:32 +0000 | [diff] [blame] | 216 | |
Gilles Peskine | fc70b52 | 2021-07-13 23:27:01 +0200 | [diff] [blame] | 217 | echo "Total Passed : $TOTAL_PASS" |
| 218 | echo "Total Failed : $TOTAL_FAIL" |
| 219 | echo "Total Skipped : $TOTAL_SKIP" |
| 220 | echo "Total exec'd tests : $TOTAL_EXED" |
| 221 | echo "Total avail tests : $TOTAL_AVAIL" |
| 222 | echo |
SimonB | 21ab9d7 | 2016-03-12 20:37:32 +0000 | [diff] [blame] | 223 | |
| 224 | |
Gilles Peskine | 24515f9 | 2024-09-11 12:46:08 +0200 | [diff] [blame] | 225 | # Step 4e - Coverage report |
Gilles Peskine | 98d3a67 | 2022-12-16 12:03:39 +0100 | [diff] [blame] | 226 | echo "Coverage statistics:" |
| 227 | sed -n '1,/^Overall coverage/d; /%/p' cov-$TEST_OUTPUT |
| 228 | echo |
Dan Handley | a8b26c2 | 2020-05-28 16:20:31 +0100 | [diff] [blame] | 229 | |
Gilles Peskine | 24515f9 | 2024-09-11 12:46:08 +0200 | [diff] [blame] | 230 | rm unit-test-$TEST_OUTPUT |
Gilles Peskine | fc70b52 | 2021-07-13 23:27:01 +0200 | [diff] [blame] | 231 | rm sys-test-$TEST_OUTPUT |
| 232 | rm compat-test-$TEST_OUTPUT |
| 233 | rm cov-$TEST_OUTPUT |
SimonB | 21ab9d7 | 2016-03-12 20:37:32 +0000 | [diff] [blame] | 234 | |
Gilles Peskine | d8d1932 | 2021-07-22 12:29:27 +0200 | [diff] [blame] | 235 | # Mark the report generation as having succeeded. This must be the |
| 236 | # last thing in the report generation. |
Gilles Peskine | 6ee3b7e | 2021-07-22 11:08:30 +0200 | [diff] [blame] | 237 | touch "basic-build-test-$$.ok" |
Gilles Peskine | fc70b52 | 2021-07-13 23:27:01 +0200 | [diff] [blame] | 238 | } | tee coverage-summary.txt |
Janos Follath | 7ccac85 | 2016-06-06 13:18:39 +0100 | [diff] [blame] | 239 | |
| 240 | make clean |
| 241 | |
| 242 | if [ -f "$CONFIG_BAK" ]; then |
| 243 | mv "$CONFIG_BAK" "$CONFIG_H" |
| 244 | fi |
Gilles Peskine | 6d6ee98 | 2020-04-09 18:28:14 +0200 | [diff] [blame] | 245 | |
Gilles Peskine | 6ee3b7e | 2021-07-22 11:08:30 +0200 | [diff] [blame] | 246 | # The file must exist, otherwise it means something went wrong while generating |
| 247 | # the coverage report. If something did go wrong, rm will complain so this |
| 248 | # script will exit with a failure status. |
Gilles Peskine | d8d1932 | 2021-07-22 12:29:27 +0200 | [diff] [blame] | 249 | rm "tests/basic-build-test-$$.ok" |