Lines Matching +full:- +full:- +full:test_output
3 # basic-build-test.sh
6 # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
14 # * Unit tests - executed using tests/scripts/run-test-suite.pl
15 # * Self-tests - executed using the test suites above
16 # * System tests - executed using tests/ssl-opt.sh
17 # * Interoperability tests - executed using tests/compat.sh
21 # Note the tests self-adapt due to configurations in include/mbedtls/mbedtls_config.h
27 # Usage: basic-build-test.sh
31 set -eu
33 if [ -d library -a -d include -a -d tests ]; then :; else
39 : ${GNUTLS_CLI:="gnutls-cli"}
40 : ${GNUTLS_SERV:="gnutls-serv"}
42 # Used to make ssl-opt.sh deterministic.
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"
55 # To avoid setting OpenSSL and GnuTLS for each call to compat.sh and ssl-opt.sh
64 # Step 0 - print build environment info
71 # Step 1 - Make and instrumented build for code coverage
72 export CFLAGS=' --coverage -g3 -O0 '
73 export LDFLAGS=' --coverage'
80 # Step 2 - Execute the tests
81 TEST_OUTPUT=out_${PPID}
83 if [ ! -f "seedfile" ]; then
88 # Step 2a - Unit Tests (keep going even if some tests fail)
90 perl scripts/run-test-suites.pl -v 2 |tee unit-test-$TEST_OUTPUT
94 # Step 2b - System Tests (keep going even if some tests fail)
96 echo '################ ssl-opt.sh ################'
97 echo "ssl-opt.sh will use SEED=$SEED for udp_proxy"
98 sh ssl-opt.sh |tee sys-test-$TEST_OUTPUT
99 echo '^^^^^^^^^^^^^^^^ ssl-opt.sh ^^^^^^^^^^^^^^^^'
102 # Step 2c - Compatibility tests (keep going even if some tests fail)
110 sh compat.sh -e '^$' -f 'NULL'
114 OPENSSL="$OPENSSL_NEXT" sh compat.sh -e '^$' -f 'ARIA\|CHACHA'
116 } | tee compat-test-$TEST_OUTPUT
120 # Step 3 - Process the coverage report
125 } | tee tests/cov-$TEST_OUTPUT
127 if [ "$(tail -n1 tests/cov-$TEST_OUTPUT)" != "SUCCESS" ]; then
133 # Step 4 - Summarise the test report
139 # A failure of the left-hand side of a pipe is ignored (this is a limitation
142 rm -f "tests/basic-build-test-$$.ok"
148 # Step 4a - Unit tests
149 echo "Unit tests - tests/scripts/run-test-suites.pl"
151 …PASSED_TESTS=$(tail -n6 unit-test-$TEST_OUTPUT|sed -n -e 's/test cases passed :[\t]*\([0-9]*\)/\1/…
152 …SKIPPED_TESTS=$(tail -n6 unit-test-$TEST_OUTPUT|sed -n -e 's/skipped :[ \t]*\([0-9]*\)/\1/p'| tr -…
153 …TOTAL_SUITES=$(tail -n6 unit-test-$TEST_OUTPUT|sed -n -e 's/.* (\([0-9]*\) .*, [0-9]* tests run)/\…
154 …FAILED_TESTS=$(tail -n6 unit-test-$TEST_OUTPUT|sed -n -e 's/failed :[\t]*\([0-9]*\)/\1/p' |tr -d '…
170 # Step 4b - TLS Options tests
171 echo "TLS Options tests - tests/ssl-opt.sh"
173 …PASSED_TESTS=$(tail -n5 sys-test-$TEST_OUTPUT|sed -n -e 's/.* (\([0-9]*\) \/ [0-9]* tests ([0-9]* …
174 …SKIPPED_TESTS=$(tail -n5 sys-test-$TEST_OUTPUT|sed -n -e 's/.* ([0-9]* \/ [0-9]* tests (\([0-9]*\)…
175 …TOTAL_TESTS=$(tail -n5 sys-test-$TEST_OUTPUT|sed -n -e 's/.* ([0-9]* \/ \([0-9]*\) tests ([0-9]* s…
176 FAILED_TESTS=$(($TOTAL_TESTS - $PASSED_TESTS))
192 # Step 4c - System Compatibility tests
193 echo "System/Compatibility tests - tests/compat.sh"
195 …PASSED_TESTS=$(cat compat-test-$TEST_OUTPUT | sed -n -e 's/.* (\([0-9]*\) \/ [0-9]* tests ([0-9]* …
196 …SKIPPED_TESTS=$(cat compat-test-$TEST_OUTPUT | sed -n -e 's/.* ([0-9]* \/ [0-9]* tests (\([0-9]*\)…
197 …EXED_TESTS=$(cat compat-test-$TEST_OUTPUT | sed -n -e 's/.* ([0-9]* \/ \([0-9]*\) tests ([0-9]* sk…
198 FAILED_TESTS=$(($EXED_TESTS - $PASSED_TESTS))
214 # Step 4d - Grand totals
215 echo "-------------------------------------------------------------------------"
226 # Step 4e - Coverage report
228 sed -n '1,/^Overall coverage/d; /%/p' cov-$TEST_OUTPUT
231 rm unit-test-$TEST_OUTPUT
232 rm sys-test-$TEST_OUTPUT
233 rm compat-test-$TEST_OUTPUT
234 rm cov-$TEST_OUTPUT
238 touch "basic-build-test-$$.ok"
239 } | tee coverage-summary.txt
243 if [ -f "$CONFIG_BAK" ]; then
250 rm "tests/basic-build-test-$$.ok"