Lines Matching +full:- +full:- +full:test_output
3 # basic-build-tests.sh
6 # SPDX-License-Identifier: Apache-2.0
12 # http://www.apache.org/licenses/LICENSE-2.0
26 # * Unit tests - executed using tests/scripts/run-test-suite.pl
27 # * Self-tests - executed using the test suites above
28 # * System tests - executed using tests/ssl-opt.sh
29 # * Interoperability tests - executed using tests/compat.sh
33 # Note the tests self-adapt due to configurations in include/mbedtls/mbedtls_config.h
39 # Usage: basic-build-tests.sh
43 set -eu
45 if [ -d library -a -d include -a -d tests ]; then :; else
52 : ${GNUTLS_CLI:="gnutls-cli"}
53 : ${GNUTLS_SERV:="gnutls-serv"}
57 # Used to make ssl-opt.sh deterministic.
65 # if MAKEFLAGS is not set add the -j option to speed up invocations of make
66 if [ -z "${MAKEFLAGS+set}" ]; then
67 export MAKEFLAGS="-j"
70 # To avoid setting OpenSSL and GnuTLS for each call to compat.sh and ssl-opt.sh
79 # Step 0 - print build environment info
89 # Step 1 - Make and instrumented build for code coverage
90 export CFLAGS=' --coverage -g3 -O0 '
91 export LDFLAGS=' --coverage'
98 # Step 2 - Execute the tests
99 TEST_OUTPUT=out_${PPID}
101 if [ ! -f "seedfile" ]; then
106 # Step 2a - Unit Tests (keep going even if some tests fail)
108 perl scripts/run-test-suites.pl -v 2 |tee unit-test-$TEST_OUTPUT
112 # Step 2b - System Tests (keep going even if some tests fail)
114 echo '################ ssl-opt.sh ################'
115 echo "ssl-opt.sh will use SEED=$SEED for udp_proxy"
116 sh ssl-opt.sh |tee sys-test-$TEST_OUTPUT
117 echo '^^^^^^^^^^^^^^^^ ssl-opt.sh ^^^^^^^^^^^^^^^^'
120 # Step 2c - Compatibility tests (keep going even if some tests fail)
124 sh compat.sh -m 'tls1_2 dtls1_2'
130 sh compat.sh -e '^$' -f 'NULL\|DES'
134 OPENSSL_CMD="$OPENSSL_NEXT" sh compat.sh -e '^$' -f 'ARIA\|CHACHA'
136 } | tee compat-test-$TEST_OUTPUT
140 # Step 3 - Process the coverage report
145 } | tee tests/cov-$TEST_OUTPUT
147 if [ "$(tail -n1 tests/cov-$TEST_OUTPUT)" != "SUCCESS" ]; then
153 # Step 4 - Summarise the test report
159 # A failure of the left-hand side of a pipe is ignored (this is a limitation
162 rm -f "tests/basic-build-test-$$.ok"
168 # Step 4a - Unit tests
169 echo "Unit tests - tests/scripts/run-test-suites.pl"
171 …PASSED_TESTS=$(tail -n6 unit-test-$TEST_OUTPUT|sed -n -e 's/test cases passed :[\t]*\([0-9]*\)/\1/…
172 …SKIPPED_TESTS=$(tail -n6 unit-test-$TEST_OUTPUT|sed -n -e 's/skipped :[ \t]*\([0-9]*\)/\1/p'| tr -…
173 …TOTAL_SUITES=$(tail -n6 unit-test-$TEST_OUTPUT|sed -n -e 's/.* (\([0-9]*\) .*, [0-9]* tests run)/\…
174 …FAILED_TESTS=$(tail -n6 unit-test-$TEST_OUTPUT|sed -n -e 's/failed :[\t]*\([0-9]*\)/\1/p' |tr -d '…
190 # Step 4b - TLS Options tests
191 echo "TLS Options tests - tests/ssl-opt.sh"
193 …PASSED_TESTS=$(tail -n5 sys-test-$TEST_OUTPUT|sed -n -e 's/.* (\([0-9]*\) \/ [0-9]* tests ([0-9]* …
194 …SKIPPED_TESTS=$(tail -n5 sys-test-$TEST_OUTPUT|sed -n -e 's/.* ([0-9]* \/ [0-9]* tests (\([0-9]*\)…
195 …TOTAL_TESTS=$(tail -n5 sys-test-$TEST_OUTPUT|sed -n -e 's/.* ([0-9]* \/ \([0-9]*\) tests ([0-9]* s…
196 FAILED_TESTS=$(($TOTAL_TESTS - $PASSED_TESTS))
212 # Step 4c - System Compatibility tests
213 echo "System/Compatibility tests - tests/compat.sh"
215 …PASSED_TESTS=$(cat compat-test-$TEST_OUTPUT | sed -n -e 's/.* (\([0-9]*\) \/ [0-9]* tests ([0-9]* …
216 …SKIPPED_TESTS=$(cat compat-test-$TEST_OUTPUT | sed -n -e 's/.* ([0-9]* \/ [0-9]* tests (\([0-9]*\)…
217 …EXED_TESTS=$(cat compat-test-$TEST_OUTPUT | sed -n -e 's/.* ([0-9]* \/ \([0-9]*\) tests ([0-9]* sk…
218 FAILED_TESTS=$(($EXED_TESTS - $PASSED_TESTS))
234 # Step 4d - Grand totals
235 echo "-------------------------------------------------------------------------"
246 # Step 4e - Coverage
249 …LINES_TESTED=$(tail -n4 cov-$TEST_OUTPUT|sed -n -e 's/ lines......: [0-9]*.[0-9]% (\([0-9]*\) of …
250 …LINES_TOTAL=$(tail -n4 cov-$TEST_OUTPUT|sed -n -e 's/ lines......: [0-9]*.[0-9]% ([0-9]* of \([0-…
251 …FUNCS_TESTED=$(tail -n4 cov-$TEST_OUTPUT|sed -n -e 's/ functions..: [0-9]*.[0-9]% (\([0-9]*\) of …
252 …FUNCS_TOTAL=$(tail -n4 cov-$TEST_OUTPUT|sed -n -e 's/ functions..: [0-9]*.[0-9]% ([0-9]* of \([0-…
253 …BRANCHES_TESTED=$(tail -n4 cov-$TEST_OUTPUT|sed -n -e 's/ branches...: [0-9]*.[0-9]% (\([0-9]*\) …
254 …BRANCHES_TOTAL=$(tail -n4 cov-$TEST_OUTPUT|sed -n -e 's/ branches...: [0-9]*.[0-9]% ([0-9]* of \(…
257 LINES_PERCENT="$(($LINES_PERCENT/10)).$(($LINES_PERCENT-($LINES_PERCENT/10)*10))"
260 FUNCS_PERCENT="$(($FUNCS_PERCENT/10)).$(($FUNCS_PERCENT-($FUNCS_PERCENT/10)*10))"
263 BRANCHES_PERCENT="$(($BRANCHES_PERCENT/10)).$(($BRANCHES_PERCENT-($BRANCHES_PERCENT/10)*10))"
265 rm unit-test-$TEST_OUTPUT
266 rm sys-test-$TEST_OUTPUT
267 rm compat-test-$TEST_OUTPUT
268 rm cov-$TEST_OUTPUT
277 touch "basic-build-test-$$.ok"
278 } | tee coverage-summary.txt
282 if [ -f "$CONFIG_BAK" ]; then
289 rm "tests/basic-build-test-$$.ok"